home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / xfe / src / Toolbox.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.8 KB  |  100 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. /* Name:        Toolbox.h                                                */
  21. /* Description:    XFE_Toolbox component header file.                        */
  22. /* Author:        Ramiro Estrugo <ramiro@netscape.com>                    */
  23. /*                                                                        */
  24. /*----------------------------------------------------------------------*/
  25.  
  26.  
  27.  
  28. #ifndef _xfe_toolbox_h
  29. #define _xfe_toolbox_h
  30.  
  31. //#include "xp_core.h"
  32.  
  33. #include "Component.h"
  34. #include "IconGroup.h"
  35. #include "icons.h"
  36.  
  37. class XFE_ToolboxItem;
  38.  
  39. class XFE_Toolbox : public XFE_Component
  40. {
  41. public:  
  42.  
  43.     Widget getToolBoxWidget        ();
  44.     Widget getLogoWidget        ();
  45.  
  46.     XFE_Toolbox(XFE_Component * toplevel_component,Widget parent);
  47.  
  48.     virtual ~XFE_Toolbox();
  49.  
  50.     void        addDragDescendant        (Widget);
  51.     void        removeDragDescendant    (Widget);
  52.     void        toggleItemState            (Widget);
  53.  
  54.     void        setItemPosition            (Widget item,int position);
  55.     void        setItemOpen                (Widget item,XP_Bool open);
  56.  
  57.     XP_Bool        stateOfItem                (Widget);
  58.     int            positionOfItem            (Widget);
  59.     Widget        tabOfItem                (Widget item,XP_Bool opened);
  60.  
  61.     // Item methods
  62.     Cardinal                getNumItems                    ();
  63.     WidgetList                getItems                    ();
  64.  
  65.     XFE_ToolboxItem *        getItemAtIndex                (Cardinal index);
  66.     XFE_ToolboxItem *        firstOpenItem                ();
  67.     XFE_ToolboxItem *        firstManagedItem            ();
  68.     XFE_ToolboxItem *        firstOpenAndManagedItem        ();
  69.  
  70.     XP_Bool isNeeded            ();
  71.  
  72.     // Invoked when one of the toolbars is closed
  73.     static const char *toolbarClose;
  74.  
  75.     // Invoked when one of the toolbars is opened
  76.     static const char *toolbarOpen;
  77.  
  78.     // Invoked when one of the toolbars is snapped
  79.     static const char *toolbarSnap;
  80.  
  81.     // Invoked when one of the toolbars is swapped
  82.     static const char *toolbarSwap;
  83.  
  84. protected:
  85.  
  86.     Widget            m_toolbox;
  87.  
  88. private:
  89.  
  90.     void    createMain        (Widget parent);
  91.  
  92.     static void            closeCallback        (Widget,XtPointer,XtPointer);
  93.     static void            openCallback        (Widget,XtPointer,XtPointer);
  94.     static void            newItemCallback        (Widget,XtPointer,XtPointer);
  95.     static void            snapCallback        (Widget,XtPointer,XtPointer);
  96.     static void            swapCallback        (Widget,XtPointer,XtPointer);
  97. };
  98.  
  99. #endif /* _xfe_toolbox_h */
  100.