home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / xfe / src / TreeView.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  3.3 KB  |  119 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.    TreeView.h -- class definition for TreeView
  20.    Created: spence murray <spence@netscape.com>, 3-Nov-97.
  21.  */
  22.  
  23.  
  24.  
  25. #ifndef _xfe_treeview_h
  26. #define _xfe_treeview_h
  27.  
  28. #include "NotificationCenter.h"
  29. #include "Outlinable.h"
  30. #include "XmL/Tree.h"
  31.  
  32. extern "C"
  33. {
  34.   #include "gridpopup.h"
  35.   #include "htrdf.h"
  36.   #include "rdf.h"
  37.  
  38. class XFE_TreeView : public XFE_Outlinable
  39. {
  40. public:
  41.     XFE_TreeView(const char *name,
  42.                  Widget parent,
  43.                  int tree_type,
  44.                  int width,
  45.                  int height);
  46.  
  47.     XFE_TreeView();
  48.     virtual ~XFE_TreeView();
  49.  
  50.     // The Outlinable interface.
  51.     void *ConvFromIndex(int index);
  52.     virtual int ConvToIndex(void *item);
  53.     virtual char *getColumnName(int column);
  54.     virtual char *getColumnHeaderText(int column);
  55.     virtual fe_icon *getColumnHeaderIcon(int column);
  56.     virtual EOutlinerTextStyle getColumnHeaderStyle(int column);
  57.     virtual void *acquireLineData(int line);
  58.     virtual void getTreeInfo(XP_Bool *expandable, XP_Bool *is_expanded, int *depth, 
  59.                              OutlinerAncestorInfo **ancestor);
  60.     virtual EOutlinerTextStyle getColumnStyle(int column);
  61.     virtual char *getColumnText(int column);
  62.     virtual fe_icon *getColumnIcon(int column);
  63.     
  64.     // Tells the Outlinable object that the line data is no
  65.     // longer needed, and it can free any storage associated with
  66.     // it.
  67.     virtual void releaseLineData();
  68.     
  69.     virtual void Buttonfunc(const OutlineButtonFuncData *data);
  70.     virtual void Flippyfunc(const OutlineFlippyFuncData *data);
  71.     
  72.     // return the outliner associated with this outlinable.
  73.     virtual XFE_Outliner *getOutliner();
  74.     
  75.     // Get tooltipString & docString; 
  76.     // returned string shall be freed by the callee
  77.     // row < 0 indicates heading row; otherwise it is a content row
  78.     // (starting from 0)
  79.     //
  80.     virtual char *getCellTipString(int row, int column);
  81.     virtual char *getCellDocString(int row, int column);
  82.  
  83.     // the notifyProc
  84.     void handleRDFNotify (HT_Notification ns, 
  85.                           HT_Resource node,
  86.                           HT_Event event);
  87. private:
  88.     // load the RDF database
  89.     void getRDFDB ();
  90.  
  91.     // fill the tree with the current RDF database
  92.     void drawTree ();
  93.  
  94.     // draw a node
  95.     void drawNode (HT_Resource node);
  96.  
  97. protected:
  98.     XFE_Outliner *m_outliner;
  99.     Widget m_tree;
  100.  
  101.     // rdf handles
  102.     RDF_Resources m_rdfResources;
  103.     HT_Pane m_htPane;
  104.     HT_View m_htView;
  105. };
  106.  
  107. extern "C" void
  108. fe_showTreeView (Widget parent, int tree_type, int width, int height);
  109.  
  110.     // the notifyProc
  111. extern "C" void
  112. xfe_handleRDFNotify (HT_Notification ns, 
  113.                  HT_Resource node,
  114.                  HT_Event event);
  115.  
  116. #endif /* _xfe_treeview_h */
  117.  
  118.