Annotation of chimera/BookmarksService.h, revision 1.5

1.1       hyatt       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"
1.3       hyatt      14: #include "nsIDocumentObserver.h"
1.4       hyatt      15: #include "nsVoidArray.h"
1.1       hyatt      16: 
                     17: class BookmarksService;
                     18: class nsIAtom;
                     19: 
                     20: @interface BookmarksDataSource : NSObject
                     21: {
                     22:     BookmarksService* mBookmarks;
                     23:     IBOutlet id mOutlineView;
                     24:     IBOutlet id mBrowserView;
1.2       hyatt      25:     IBOutlet id mAddButton;
                     26:     IBOutlet id mDeleteButton;
1.1       hyatt      27: }
                     28: 
                     29: -(id) init;
                     30: -(void) dealloc;
1.4       hyatt      31: -(void) windowClosing;
1.1       hyatt      32: 
                     33: -(void) ensureBookmarks;
1.2       hyatt      34: 
                     35: -(IBAction)addBookmark:(id)aSender;
                     36: -(IBAction)deleteBookmark: (id)aSender;
1.1       hyatt      37: 
                     38: // Datasource methods.
                     39: - (id)outlineView:(NSOutlineView *)outlineView child:(int)index ofItem:(id)item;
                     40: - (BOOL)outlineView:(NSOutlineView *)outlineView isItemExpandable:(id)item;
                     41: - (int)outlineView:(NSOutlineView *)outlineView numberOfChildrenOfItem:(id)item;
                     42: - (id)outlineView:(NSOutlineView *)outlineView objectValueForTableColumn:(NSTableColumn *)tableColumn byItem:(id)item;
                     43: - (void)outlineView:(NSOutlineView *)outlineView setObjectValue:(id)object forTableColumn:(NSTableColumn *)tableColumn byItem:(id)item;
                     44: 
1.4       hyatt      45: - (void)reloadDataForItem:(id)item reloadChildren: (BOOL)aReloadChildren;
                     46: 
1.1       hyatt      47: @end
                     48: 
                     49: @interface BookmarkItem : NSObject
                     50: {
                     51:     nsIContent* mContentNode;
                     52: }
                     53: 
                     54: -(nsIContent*)contentNode;
                     55: -(void)setContentNode: (nsIContent*)aContentNode;
                     56: @end
                     57: 
1.4       hyatt      58: class BookmarksService
1.1       hyatt      59: {
                     60: public:
1.4       hyatt      61:     BookmarksService(BookmarksDataSource* aDataSource);
1.3       hyatt      62:     virtual ~BookmarksService();
1.1       hyatt      63:     
1.3       hyatt      64:     void AddObserver();
                     65:     void RemoveObserver();
                     66: 
1.4       hyatt      67:     void NotifyObserver(nsIContent* aContainer, PRBool aReloadChildren);
                     68:     static void NotifyObservers(nsIContent* aContainer, PRBool aReloadChildren);
                     69: 
1.3       hyatt      70: public:
1.4       hyatt      71:     void GetRootContent(nsIContent** aResult);
1.3       hyatt      72:     static BookmarkItem* GetWrapperFor(nsIContent* aItem);
1.5     ! hyatt      73:     static void FlushBookmarks();
1.1       hyatt      74:     
                     75: private:
1.3       hyatt      76:     // Global counter and pointers to our singletons.
1.1       hyatt      77:     static PRUint32 gRefCnt;
1.3       hyatt      78:     static NSMutableDictionary* gDictionary;
                     79:     
1.1       hyatt      80: public:
                     81:     static nsIAtom* gFolderAtom;
                     82:     static nsIAtom* gNameAtom;
                     83:     static nsIAtom* gHrefAtom;
                     84:     static nsIAtom* gBookmarkAtom;
1.4       hyatt      85:     static nsIDocument* gBookmarks;
                     86:     static nsVoidArray* gInstances;
                     87:     
                     88: private:
                     89:     BookmarksDataSource* mDataSource;
1.1       hyatt      90: };

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