Back to index

lightning-sunbird  0.9+nobinonly
CBrowserMsgDefs.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is mozilla.org code.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 2002
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *  Conrad Carlen <ccarlen@netscape.com>
00024  *
00025  * Alternatively, the contents of this file may be used under the terms of
00026  * either the GNU General Public License Version 2 or later (the "GPL"), or
00027  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00028  * in which case the provisions of the GPL or the LGPL are applicable instead
00029  * of those above. If you wish to allow use of your version of this file only
00030  * under the terms of either the GPL or the LGPL, and not to allow others to
00031  * use your version of this file under the terms of the MPL, indicate your
00032  * decision by deleting the provisions above and replace them with the notice
00033  * and other provisions required by the GPL or the LGPL. If you do not delete
00034  * the provisions above, a recipient may use your version of this file under
00035  * the terms of any one of the MPL, the GPL or the LGPL.
00036  *
00037  * ***** END LICENSE BLOCK ***** */
00038 
00039 #ifndef __CBrowserShellMsgDefs__
00040 #define __CBrowserShellMsgDefs__
00041 
00042 #pragma once
00043 
00044 // Messages sent by CBrowserShell
00045 
00046 #ifndef EMBED_MSG_BASE_ID
00047 #define EMBED_MSG_BASE_ID 1000
00048 #endif
00049 
00050 enum {
00051     msg_OnNetStartChange      = EMBED_MSG_BASE_ID + 0,
00052     msg_OnNetStopChange       = EMBED_MSG_BASE_ID + 1,
00053     msg_OnProgressChange      = EMBED_MSG_BASE_ID + 2,
00054     msg_OnLocationChange      = EMBED_MSG_BASE_ID + 3,
00055     msg_OnStatusChange        = EMBED_MSG_BASE_ID + 4,
00056     msg_OnSecurityChange      = EMBED_MSG_BASE_ID + 5,
00057     
00058     msg_OnChromeStatusChange  = EMBED_MSG_BASE_ID + 6
00059 };
00060 
00061 
00067 // msg_OnNetStartChange
00068 struct MsgNetStartInfo
00069 {
00070     MsgNetStartInfo(CBrowserShell* broadcaster) :
00071         mBroadcaster(broadcaster)
00072         { }
00073     
00074     CBrowserShell *mBroadcaster;      
00075 };
00076 
00077 // msg_OnNetStopChange
00078 struct MsgNetStopInfo
00079 {
00080     MsgNetStopInfo(CBrowserShell* broadcaster) :
00081         mBroadcaster(broadcaster)
00082         { }
00083     
00084     CBrowserShell *mBroadcaster;      
00085 };
00086 
00087 // msg_OnProgressChange
00088 struct MsgOnProgressChangeInfo
00089 {
00090     MsgOnProgressChangeInfo(CBrowserShell* broadcaster, PRInt32 curProgress, PRInt32 maxProgress) :
00091         mBroadcaster(broadcaster), mCurProgress(curProgress), mMaxProgress(maxProgress)
00092         { }
00093     
00094     CBrowserShell *mBroadcaster;      
00095     PRInt32 mCurProgress, mMaxProgress;
00096 };
00097 
00098 // msg_OnLocationChange
00099 struct MsgLocationChangeInfo
00100 {
00101     MsgLocationChangeInfo(CBrowserShell* broadcaster,
00102                           const char* urlSpec) :
00103         mBroadcaster(broadcaster), mURLSpec(urlSpec)
00104         { }
00105     
00106     CBrowserShell *mBroadcaster;
00107     const char *mURLSpec;     
00108 };
00109 
00110 // msg_OnStatusChange
00111 struct MsgStatusChangeInfo
00112 {
00113     MsgStatusChangeInfo(CBrowserShell* broadcaster,
00114                         nsresult status, const PRUnichar *message) :
00115         mBroadcaster(broadcaster),
00116         mStatus(status), mMessage(message)
00117         { }
00118     
00119     CBrowserShell *mBroadcaster;
00120     nsresult mStatus;
00121     const PRUnichar *mMessage;     
00122 };
00123 
00124 // msg_OnSecurityChange
00125 struct MsgSecurityChangeInfo
00126 {
00127     MsgSecurityChangeInfo(CBrowserShell* broadcaster,
00128                           PRUint32 state) :
00129         mBroadcaster(broadcaster),
00130         mState(state)
00131         { }
00132     
00133     CBrowserShell *mBroadcaster;
00134     PRUint32 mState;
00135 }; 
00136 
00137 // msg_OnChromeStatusChange
00138 // See nsIWebBrowserChrome::SetStatus
00139 struct MsgChromeStatusChangeInfo
00140 {
00141     MsgChromeStatusChangeInfo(CBrowserShell* broadcaster,
00142                               PRUint32 statusType,
00143                               const PRUnichar* status) :
00144         mBroadcaster(broadcaster),
00145         mStatusType(statusType), mStatus(status)
00146         { }
00147                      
00148     CBrowserShell *mBroadcaster;
00149     PRUint32  mStatusType;
00150     const PRUnichar *mStatus;
00151 };
00152 
00153 #endif // __CBrowserShellMsgDefs__