home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / xfe / src / MozillaApp.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  3.7 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.    MozillaApp.h -- Class which represents the application
  20.    Created: Chris Toshok <toshok@netscape.com>, 24-Sep-96.
  21.    */
  22.  
  23.  
  24.  
  25. #ifndef _xfe_mozillaapp_h
  26. #define _xfe_mozillaapp_h
  27.  
  28. #include "xpassert.h"
  29. #include "xp_core.h"
  30. #include "xp_list.h"
  31.  
  32. #include "Frame.h"
  33. #include "NotificationCenter.h"
  34.  
  35. class XFE_Frame;
  36.  
  37. class XFE_MozillaApp : public XFE_NotificationCenter {
  38. public:
  39.   XFE_MozillaApp(int *argc, char **argv);
  40.   XFE_MozillaApp(); // hacked constructor for now.
  41.   
  42.   void exit(int status = 0);
  43.   
  44.   void registerFrame(XFE_Frame *f);
  45.   void unregisterFrame(XFE_Frame *f); // Frame's destructor was called.
  46.  
  47.   XP_List *getFrameList(EFrameType type);
  48.   XP_List *getAllFrameList();
  49.  
  50.   int toplevelWindowCount();
  51.   int mailNewsWindowCount();
  52.  
  53.   XP_Bool getBusy();
  54.  
  55.   static XFE_MozillaApp *theApp();
  56.  
  57.   static const char *appBusyCallback;
  58.   static const char *appNotBusyCallback;
  59.  
  60.   static const char *changeInToplevelFrames;
  61.   static const char *bookmarksHaveChanged;
  62.   static const char *biffStateChanged;
  63.   static const char *updateToolbarAppearance;
  64.   static const char *linksAttributeChanged; 
  65.   static const char *defaultColorsChanged; 
  66.   static const char *defaultFontChanged; 
  67.   static const char *refreshMsgWindow; 
  68.   static const char *personalToolbarFolderChanged; 
  69.  
  70.   // called when a registered frame is being destroyed.
  71.   XFE_CALLBACK_DECL(frameUnregistering)
  72.   XFE_CALLBACK_DECL(updateBusyState)
  73.  
  74. private:
  75.   XP_Bool m_isbusy;
  76.  
  77.   int fe_MNWindowCount;
  78.   XFE_Frame *session_frame;
  79.  
  80.   XP_List *m_frameList;
  81.  
  82.   void closeFrames(XP_List *frame_list);
  83.   XP_Bool isOkToExitFrameList(XP_List *frame_list);
  84.   XP_Bool isOkToExitNonMailNewsFrames();
  85.   XP_Bool isOkToExitMailNewsFrames();
  86.  
  87.   // this is wasteful, but it makes the deletion code _much_ nicer.
  88.   XP_List *m_msgFrameList;
  89.   XP_List *m_threadFrameList;
  90.   XP_List *m_folderFrameList;
  91.   XP_List *m_composeFrameList;
  92.   XP_List *m_searchFrameList;
  93.   XP_List *m_ldapFrameList;
  94.   XP_List *m_editorFrameList;
  95.   XP_List *m_browserFrameList;
  96.   XP_List *m_addressbookFrameList;
  97.   XP_List *m_bookmarkFrameList;
  98.   XP_List *m_mailfilterFrameList;
  99.   XP_List *m_maildownloadFrameList;
  100.   XP_List *m_historyFrameList;
  101.   XP_List *m_downloadFrameList;
  102.   XP_List *m_htmldialogFrameList;
  103.   XP_List *m_navcenterFrameList;
  104.  
  105.   XP_Bool m_exiting; /* used by unregisterFrame to determine whether the 
  106.             session manager stuff should be updated */
  107.   int     m_exitstatus; /* exit status passed as argument to exit() method. */
  108.  
  109.   XP_Bool m_actioninstalled; /* if the xfeDoCommand() action has been added. */
  110.  
  111.   int     m_exitwindowcount;  /* # XFE_Frames currently registered      */
  112.   XP_Bool timeToDie();        /* determine if there are any windows left*/
  113.   void    byebye(int status); /* final, final, final finalization code  */
  114. };
  115.  
  116. extern "C" XFE_MozillaApp *theMozillaApp();
  117.  
  118. #endif /* _xfe_mozillaapp_h */
  119.