1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: interface.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #include <sys/types.h>
37 #include <gdk/gdkkeysyms.h>
50 // returns success, on true application will quit
51 bool save_crash_report( const std::string
& rFileName
, const std::hash_map
< std::string
, std::string
>& rSettings
);
52 // returns success, on true application will quit
53 bool send_crash_report( WizardDialog
*pDialog
, const std::hash_map
< std::string
, std::string
>& rSettings
);
54 // must return a valid UTF8 string containing the message that will be sent
55 std::string
crash_get_details( const std::hash_map
< std::string
, std::string
>& rSettings
);
60 static void init( int argc
, char** argv
);
61 static const char* get( const char* pKey
);
67 std::string m_aWizardTitle
;
68 GtkWidget
* m_pPageContents
;
69 WizardDialog
* m_pDialog
;
71 WizardPage( WizardDialog
* pDialog
) : m_pDialog( pDialog
) {}
72 virtual ~WizardPage();
74 const char* getTitle() const { return m_aWizardTitle
.c_str(); }
75 GtkWidget
* getContents() const { return m_pPageContents
; }
77 virtual void update() = 0;
82 std::vector
< WizardPage
* > m_aPages
;
85 GtkWidget
* m_pTopLevel
;
87 GtkWidget
* m_pViewPort
;
88 GtkWidget
* m_pWizardTitle
;
89 GtkWidget
* m_pPageArea
;
90 GtkWidget
* m_pSeparator
;
91 GtkWidget
* m_pButtonBox
;
92 GtkWidget
* m_pBackButton
;
93 GtkWidget
* m_pNextButton
;
94 GtkWidget
* m_pSendButton
;
95 GtkWidget
* m_pCancelButton
;
97 GtkWidget
* m_pStatusDialog
;
99 std::hash_map
< std::string
, std::string
> m_aSettings
;
101 static gint
button_clicked( GtkWidget
* pButton
, WizardDialog
* pThis
);
109 // takes ownership of page
110 void insertPage( WizardPage
* pPage
);
112 void show( bool bShow
= true );
113 void show_messagebox( const std::string
& rMessage
);
114 gint
show_sendingstatus( bool bInProgress
);
115 void hide_sendingstatus();
117 std::hash_map
< std::string
, std::string
>& getSettings() { return m_aSettings
; }
118 GtkWindow
* getTopLevel() const { return GTK_WINDOW(m_pTopLevel
); }
121 class MainPage
: public WizardPage
124 GtkWidget
* m_pEditLabel
;
126 GtkWidget
* m_pEntryLabel
;
127 GtkWidget
* m_pEntryVBox
;
128 GtkWidget
* m_pScrolledEntry
;
131 GtkWidget
* m_pRightColumn
;
132 GtkWidget
* m_pLeftColumn
;
133 GtkWidget
* m_pDetails
;
136 GtkWidget
* m_pOptions
;
137 GtkWidget
* m_pAddressLabel
;
138 GtkWidget
* m_pAddress
;
140 static gint
button_clicked( GtkWidget
* pButton
, MainPage
* pThis
);
141 static gint
button_toggled( GtkWidget
* pButton
, MainPage
* pThis
);
144 MainPage( WizardDialog
* );
147 virtual void update();
150 class WelcomePage
: public WizardPage
153 WelcomePage( WizardDialog
* );
154 virtual ~WelcomePage();
156 virtual void update();
161 GtkWidget
* m_pDialog
;
163 GtkWidget
* m_pLeftColumn
;
165 GtkWidget
* m_pDirect
;
166 GtkWidget
* m_pManual
;
167 GtkWidget
* m_pServerLabel
;
168 GtkWidget
* m_pServer
;
170 GtkWidget
* m_pPortLabel
;
173 GtkWidget
* m_pOkButton
;
174 GtkWidget
* m_pCancelButton
;
175 GtkWidget
* m_pButtonBox
;
178 GtkWidget
* m_pVBoxServer
;
179 GtkWidget
* m_pVBoxPort
;
181 static gint
button_toggled( GtkWidget
* pButton
, OptionsDialog
* pThis
);
184 OptionsDialog( GtkWindow
* pParent
,
185 std::hash_map
< std::string
, std::string
>& rSettings
);
186 virtual ~OptionsDialog();
188 std::string
getUseProxy();
189 std::string
getServer();
190 std::string
getPort();