gecko-dev/widget/public/nsIAppShell.h

135 lines
2.9 KiB
C
Raw Normal View History

1998-04-13 20:24:54 +00:00
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsIAppShell_h__
#define nsIAppShell_h__
1998-04-13 20:24:54 +00:00
#include "nsString.h"
#include "nsIEventQueue.h"
1998-04-13 20:24:54 +00:00
/**
1998-06-04 18:12:10 +00:00
* Flags for the getNativeData function.
* See GetNativeData()
*/
1998-06-04 18:12:10 +00:00
#define NS_NATIVE_SHELL 0
1998-06-04 18:12:10 +00:00
#define NS_IAPPSHELL_IID \
1999-01-14 05:37:28 +00:00
{ 0xa0757c31, 0xeeac, 0x11d1, { 0x9e, 0xc1, 0x0, 0xaa, 0x0, 0x2f, 0xb8, 0x21 } }
1998-06-04 18:12:10 +00:00
1998-06-04 18:53:22 +00:00
/**
* During the nsIAppShell Run method notify this listener
* after each message dispatch.
* @see SetDispatchListener member function of nsIAppShell
*/
class nsDispatchListener {
public:
virtual void AfterDispatch() = 0;
};
class nsIWidget;
1998-06-04 18:53:22 +00:00
/**
* Application shell used for Test applications
*/
1998-04-13 20:24:54 +00:00
class nsIAppShell : public nsISupports
{
1998-04-13 20:24:54 +00:00
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IAPPSHELL_IID)
1998-04-13 20:24:54 +00:00
/**
* Creates an application shell
*/
1998-04-13 20:24:54 +00:00
NS_IMETHOD Create(int* argc, char ** argv) = 0;
1998-04-13 20:24:54 +00:00
/**
* Enter an event loop.
* Don't leave until application exits.
*/
virtual nsresult Run() = 0;
1998-04-13 20:24:54 +00:00
/**
* Prepare to process events.
*/
NS_IMETHOD Spinup() = 0;
/**
* Prepare to stop processing events.
*/
NS_IMETHOD Spindown() = 0;
/**
* Push event queue onto current thread and begin processing events from it
*/
NS_IMETHOD PushThreadEventQueue() = 0;
/**
* Pop event queue from current thread's stack
*/
NS_IMETHOD PopThreadEventQueue() = 0;
/**
* After event dispatch execute app specific code
*/
NS_IMETHOD GetNativeEvent(PRBool &aRealEvent, void *&aEvent) = 0;
/**
* After event dispatch execute app specific code
*/
NS_IMETHOD DispatchNativeEvent(PRBool aRealEvent, void * aEvent) = 0;
1998-06-04 18:53:22 +00:00
/**
* After event dispatch execute app specific code
*/
NS_IMETHOD SetDispatchListener(nsDispatchListener* aDispatchListener) = 0;
1998-06-04 18:53:22 +00:00
/**
* Exit the handle event loop
*/
1998-04-13 20:24:54 +00:00
NS_IMETHOD Exit() = 0;
1998-04-13 20:24:54 +00:00
1998-06-04 21:00:40 +00:00
/**
* Returns Native Data
*/
1998-06-04 21:37:14 +00:00
virtual void* GetNativeData(PRUint32 aDataType) = 0;
1998-06-04 21:00:40 +00:00
/**
* Determines whether a given event should be processed assuming the given
* widget is a currently active modal window
*/
NS_IMETHOD EventIsForModalWindow(PRBool aRealEvent, void *aEvent, nsIWidget *aWidget,
PRBool *aForWindow) = 0;
1998-06-04 21:00:40 +00:00
};
1998-04-13 20:24:54 +00:00
#endif // nsIAppShell_h__
1998-04-13 20:24:54 +00:00
1998-06-04 18:53:22 +00:00