File:  [mozdev] / chimera / BookmarksService.h
Revision 1.2: download - view: text, annotated - select for diffs - revision graph
Sat Feb 9 01:24:11 2002 UTC (18 years, 3 months ago) by hyatt
Branches: MAIN
CVS tags: HEAD
Stubs for adding bookmarks.

    1: /*
    2:  *  BookmarksService.h
    3:  *  Chimera
    4:  *
    5:  *  Created by David Hyatt on Thu Feb 07 2002.
    6:  *  Copyright (c) 2001 __MyCompanyName__. All rights reserved.
    7:  *
    8:  */
    9: 
   10: #include <Appkit/Appkit.h>
   11: #include <Carbon/Carbon.h>
   12: #include "nsCOMPtr.h"
   13: #include "nsIDocument.h"
   14: 
   15: class nsIDocumentObserver;
   16: class BookmarksService;
   17: class nsIAtom;
   18: 
   19: @interface BookmarksDataSource : NSObject
   20: {
   21:     BookmarksService* mBookmarks;
   22:     IBOutlet id mOutlineView;
   23:     IBOutlet id mBrowserView;
   24:     IBOutlet id mAddButton;
   25:     IBOutlet id mDeleteButton;
   26: }
   27: 
   28: -(id) init;
   29: -(void) dealloc;
   30: 
   31: -(void) ensureBookmarks;
   32: 
   33: -(IBAction)addBookmark:(id)aSender;
   34: -(IBAction)deleteBookmark: (id)aSender;
   35: 
   36: // Datasource methods.
   37: - (id)outlineView:(NSOutlineView *)outlineView child:(int)index ofItem:(id)item;
   38: - (BOOL)outlineView:(NSOutlineView *)outlineView isItemExpandable:(id)item;
   39: - (int)outlineView:(NSOutlineView *)outlineView numberOfChildrenOfItem:(id)item;
   40: - (id)outlineView:(NSOutlineView *)outlineView objectValueForTableColumn:(NSTableColumn *)tableColumn byItem:(id)item;
   41: - (void)outlineView:(NSOutlineView *)outlineView setObjectValue:(id)object forTableColumn:(NSTableColumn *)tableColumn byItem:(id)item;
   42: 
   43: @end
   44: 
   45: @interface BookmarkItem : NSObject
   46: {
   47:     nsIContent* mContentNode;
   48: }
   49: 
   50: -(nsIContent*)contentNode;
   51: -(void)setContentNode: (nsIContent*)aContentNode;
   52: @end
   53: 
   54: class BookmarksService
   55: {
   56: public:
   57:     BookmarksService();
   58:     ~BookmarksService();
   59:     
   60:     static BookmarksService* AddObserver(nsIDocumentObserver* aObserver);
   61:     static void RemoveObserver(nsIDocumentObserver* aObserver);
   62:     
   63:     void GetRootContent(nsIContent** aResult);
   64:     BookmarkItem* GetWrapperFor(nsIContent* aItem);
   65:     
   66: private:
   67:     // Global counter and pointer to our singleton.
   68:     static PRUint32 gRefCnt;
   69:     static BookmarksService* gSingleton;
   70: 
   71: public:
   72:     static nsIAtom* gFolderAtom;
   73:     static nsIAtom* gNameAtom;
   74:     static nsIAtom* gHrefAtom;
   75:     static nsIAtom* gBookmarkAtom;
   76: 
   77: private: // Singleton members.
   78:     nsCOMPtr<nsIDocument> mBookmarks;
   79:     NSMutableDictionary* mDictionary;
   80: };

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>