home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / macfe / rdfui / CRDFCoordinator.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  3.5 KB  |  102 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. //
  20. // Mike Pinkerton, Netscape Communications
  21. //
  22. // The view that contains the "selector widget" (an object that selects the different 
  23. // RDF "views" stored in the RDF database) and the the "tree view" which displays the selected RDF
  24. // view like the Finder list view.
  25. //
  26. // It's mainly responsible for coordinating the UI with the HT/RDF XP code.
  27. //
  28.  
  29. #pragma once
  30.  
  31. #include <PP_Types.h>
  32. #include <LView.h>
  33. #include <LListener.h>
  34.  
  35. #include "CRDFNotificationHandler.h"
  36. #include "CShelfMixin.h"
  37. #include "CNavCenterSelectorPane.h"
  38.  
  39. class CHyperTreeFlexTable;
  40.  
  41.  
  42. class CRDFCoordinator :    public LView,
  43.                         public LListener, public LCommander, LBroadcaster,
  44.                         public CRDFNotificationHandler,
  45.                         public LDragAndDrop
  46. {
  47. public:
  48.     enum { class_ID = 'RCoo', pane_ID = 'RCoo' };
  49.     
  50.     static const char* Pref_EditWorkspace;
  51.     static const char* Pref_ShowNavCenterSelector;
  52.     static const char* Pref_ShowNavCenterShelf;
  53.         
  54.                     CRDFCoordinator(LStream* inStream);
  55.     virtual            ~CRDFCoordinator();
  56.  
  57.         // save/restore user preferences
  58.     virtual void    SavePlace ( LStream* outStreamData ) ;
  59.     virtual void    RestorePlace ( LStream* outStreamData ) ;
  60.     
  61.         // Set the current workspace to a particular kind of workspace
  62.     virtual void SelectView ( HT_ViewType inPane ) ;
  63.         
  64.         // access to the two shelves that comprise the NavCenter. These wrapper classes
  65.         // allow you to easily slide in/out the shelves or check if they are open.
  66.     CShelf& NavCenterShelf() const { return *mNavCenter; } ;        // tree view
  67.     CShelf& NavCenterSelector() const { return *mSelector; } ;        // selector widget
  68.  
  69.         // register/unregister this NavCenter for SiteMap updates, etc
  70.     void RegisterNavCenter ( MWContext* inContext ) ;
  71.     void UnregisterNavCenter ( ) ;
  72.  
  73. protected:
  74.  
  75.         // PowerPlant overrides
  76.     virtual    void    FinishCreateSelf();
  77.     virtual Boolean    ObeyCommand ( CommandT inCommand, void* ioParam );
  78.     virtual Boolean HandleKeyPress ( const EventRecord &inKeyEvent ) ;
  79.         
  80.         // change the currently selected workspace
  81.     virtual void    SelectView(HT_View view);
  82.     
  83.     virtual void    ExpandNode(HT_Resource node);
  84.     virtual void    CollapseNode(HT_Resource node);
  85.  
  86.         // messaging and notifications
  87.     virtual    void    HandleNotification( HT_Notification    notifyStruct, HT_Resource node, HT_Event event);
  88.     virtual void    ListenToMessage( MessageT inMessage, void *ioParam);
  89.  
  90.     PaneIDT                    mSelectorPaneID;    // for the selector shelf
  91.     CNavCenterSelectorPane*    mSelectorPane;
  92.     CShelf*                    mSelector;
  93.  
  94.     PaneIDT                    mTreePaneID;        // for the tree view shelf
  95.     CHyperTreeFlexTable*    mTreePane;
  96.     CShelf*                 mNavCenter;
  97.     
  98.     HT_Pane            mHTPane;                    // the HT pane containing all the workspaces
  99.     
  100.     bool            mIsInChrome;                // are we embedded in chrome?
  101.     
  102. }; // CRDFCoordinator