2 * Copyright (C) 2007 Sergey Yanovich <ynvich@gmail.com>
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of the
7 * License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public
15 * License along with this program; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
20 #ifndef AASESSIONHISTORY_H
21 #define AASESSIONHISTORY_H 1
23 #define AA_SESSIONHISTORY_CID \
24 {0xceee0f16, 0x7194, 0x4831, {0xac, 0x37, 0x3c, 0xd2, 0x5f, 0xb1, 0x09, 0x6b}}
25 #define AA_SESSIONHISTORY_CONTRACT "@aasii.org/view/session-history;1"
27 #include "nsISHistory.h"
28 #include "nsISHistoryInternal.h"
29 #include "nsIWebNavigation.h"
30 #include "aaISHistory.h"
31 #include "aaISession.h"
34 #define NS_FORWARD_NSIWEBNAVIGATION_R(_to) \
35 NS_SCRIPTABLE NS_IMETHOD GetCanGoBack(PRBool *aCanGoBack) { return _to GetCanGoBack(aCanGoBack); } \
36 NS_SCRIPTABLE NS_IMETHOD GetCanGoForward(PRBool *aCanGoForward) { return _to GetCanGoForward(aCanGoForward); } \
37 NS_SCRIPTABLE NS_IMETHOD GoBack(void) { return _to GoBack(); } \
38 NS_SCRIPTABLE NS_IMETHOD GoForward(void) { return _to GoForward(); } \
39 NS_SCRIPTABLE NS_IMETHOD GotoIndex(PRInt32 index) { return _to GotoIndex(index); } \
40 NS_SCRIPTABLE NS_IMETHOD Reload(PRUint32 aReloadFlags) { return _to Reload(aReloadFlags); } \
41 NS_SCRIPTABLE NS_IMETHOD Stop(PRUint32 aStopFlags) { return _to Stop(aStopFlags); } \
42 NS_SCRIPTABLE NS_IMETHOD GetDocument(nsIDOMDocument * *aDocument) { return _to GetDocument(aDocument); } \
43 NS_SCRIPTABLE NS_IMETHOD GetCurrentURI(nsIURI * *aCurrentURI) { return _to GetCurrentURI(aCurrentURI); } \
44 NS_SCRIPTABLE NS_IMETHOD GetReferringURI(nsIURI * *aReferringURI) { return _to GetReferringURI(aReferringURI); } \
45 NS_SCRIPTABLE NS_IMETHOD GetSessionHistory(nsISHistory * *aSessionHistory) { return _to GetSessionHistory(aSessionHistory); } \
46 NS_SCRIPTABLE NS_IMETHOD SetSessionHistory(nsISHistory * aSessionHistory) { return _to SetSessionHistory(aSessionHistory); }
49 class nsISHistoryInternal
;
50 class nsIWebNavigation
;
54 class aaSessionHistory
: public nsISHistory
,
55 public nsISHistoryInternal
,
56 public nsIWebNavigation
,
62 virtual ~aaSessionHistory();
64 NS_FORWARD_NSISHISTORY(mSH
->)
65 NS_DECL_NSISHISTORYINTERNAL
66 NS_FORWARD_NSIWEBNAVIGATION_R(mWN
->)
67 NS_SCRIPTABLE NS_IMETHOD
LoadURI(const PRUnichar
*aURI
, PRUint32 aLoadFlags
,
68 nsIURI
*aReferrer
, nsIInputStream
*aPostData
, nsIInputStream
*aHeaders
);
69 NS_FORWARD_AAISAVEQUERY(mSession
->)
70 NS_FORWARD_SAFE_AAISESSION(get_mSession())
73 nsresult
Init() {return mWN
? NS_OK
: NS_ERROR_FAILURE
;}
75 friend class aaViewTest
;
77 nsCOMPtr
<aaISession
> mSession
;
78 nsCOMPtr
<nsISHistory
> mSH
;
79 nsCOMPtr
<nsISHistoryInternal
> mSHI
;
80 nsCOMPtr
<nsIWebNavigation
> mWN
;
81 nsCOMPtr
<nsIFile
> mFile
;
84 nsCOMPtr
<nsISupports
> mQueryBuffer
;
86 aaIPageView
* getDestination(PRInt32 offset
, nsresult
&rv
);
87 aaISession
* get_mSession();
90 #endif /* AASESSIONHISTORY_H */
92 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
93 /* vim:set ts=2 sw=2 sts=2 et cindent tw=79 ft=cpp: */