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.
|
|
|
|
*/
|
1998-05-20 22:02:14 +00:00
|
|
|
#ifndef nsIAppShell_h__
|
|
|
|
#define nsIAppShell_h__
|
1998-04-13 20:24:54 +00:00
|
|
|
|
1998-05-20 22:02:14 +00:00
|
|
|
#include "nsString.h"
|
1998-04-13 20:24:54 +00:00
|
|
|
|
1998-06-01 17:04:16 +00:00
|
|
|
/**
|
1998-06-04 18:12:10 +00:00
|
|
|
* Flags for the getNativeData function.
|
|
|
|
* See GetNativeData()
|
1998-06-01 17:04:16 +00:00
|
|
|
*/
|
1998-06-04 18:12:10 +00:00
|
|
|
#define NS_NATIVE_SHELL 0
|
1998-06-01 17:04:16 +00:00
|
|
|
|
|
|
|
|
1998-06-04 18:12:10 +00:00
|
|
|
#define NS_IAPPSHELL_IID \
|
|
|
|
{ 0xa0757c31, 0xeeac, 0x11d1, { 0x9e, 0xc1, 0x0, 0xaa, 0x0, 0x2f, 0xb8, 0x21 } };
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
1998-05-20 22:02:14 +00:00
|
|
|
/**
|
|
|
|
* Application shell used for Test applications
|
|
|
|
*/
|
1998-04-13 20:24:54 +00:00
|
|
|
|
1998-05-20 22:02:14 +00:00
|
|
|
class nsIAppShell : public nsISupports
|
|
|
|
{
|
1998-04-13 20:24:54 +00:00
|
|
|
|
1998-05-20 22:02:14 +00:00
|
|
|
public:
|
1998-04-13 20:24:54 +00:00
|
|
|
|
1998-05-20 22:02:14 +00:00
|
|
|
/**
|
|
|
|
* Creates an application shell
|
|
|
|
*/
|
1998-04-13 20:24:54 +00:00
|
|
|
|
1998-06-04 18:12:10 +00:00
|
|
|
virtual void Create(int* argc, char ** argv) = 0;
|
1998-04-13 20:24:54 +00:00
|
|
|
|
1998-05-20 22:02:14 +00:00
|
|
|
/**
|
|
|
|
* Enter an event loop.
|
|
|
|
* Don't leave until application exits.
|
|
|
|
*/
|
|
|
|
|
|
|
|
virtual nsresult Run() = 0;
|
1998-04-13 20:24:54 +00:00
|
|
|
|
1998-06-04 18:53:22 +00:00
|
|
|
/**
|
|
|
|
* After event dispatch execute app specific code
|
|
|
|
*/
|
|
|
|
|
|
|
|
virtual void SetDispatchListener(nsDispatchListener* aDispatchListener) = 0;
|
|
|
|
|
1998-05-20 22:02:14 +00:00
|
|
|
/**
|
|
|
|
* Exit the handle event loop
|
|
|
|
*/
|
1998-04-13 20:24:54 +00:00
|
|
|
|
1998-05-20 22:02:14 +00:00
|
|
|
virtual void 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
|
|
|
|
|
|
|
|
1998-05-20 22:02:14 +00:00
|
|
|
};
|
1998-04-13 20:24:54 +00:00
|
|
|
|
1998-05-20 22:02:14 +00:00
|
|
|
#endif // nsIAppShell_h__
|
1998-04-13 20:24:54 +00:00
|
|
|
|
1998-06-04 18:53:22 +00:00
|
|
|
|