Update ooo320-m1
[ooovba.git] / extensions / source / preload / oemwiz.hxx
blobcb7a33c6ce0b6a4e64b72ac78ae3c76a5136735c
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: oemwiz.hxx,v $
10 * $Revision: 1.6 $
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 #ifndef _EXTENSIONS_PRELOAD_OEMWIZ_HXX_
32 #define _EXTENSIONS_PRELOAD_OEMWIZ_HXX_
34 #include <com/sun/star/beans/XPropertySet.hpp>
35 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
36 #include <svtools/wizdlg.hxx>
37 #ifndef _SV_BUTTON_HXX
38 #include <vcl/button.hxx>
39 #endif
40 #include <vcl/tabpage.hxx>
41 #include <vcl/fixed.hxx>
42 #include <svtools/svmedit.hxx>
43 #include <svtools/lstner.hxx>
44 #include <vcl/scrbar.hxx>
46 //.........................................................................
47 namespace preload
49 #define OEM_WELCOME 0
50 #define OEM_LICENSE 1
51 #define OEM_USERDATA 2
53 //.........................................................................
54 //=====================================================================
55 //= OEMPreloadDialog
56 //=====================================================================
57 struct OEMPreloadDialog_Impl;
58 class OEMPreloadDialog : public WizardDialog
60 PushButton aPrevPB;
61 PushButton aNextPB;
62 CancelButton aCancelPB;
64 String aNextST;
65 String aAcceptST;
66 String aFinishST;
67 String aDlgTitle;
68 String aLicense;
69 String aUserData;
70 OEMPreloadDialog_Impl* pImpl;
72 DECL_LINK(NextPrevPageHdl, PushButton*);
73 protected:
75 public:
76 OEMPreloadDialog(
77 Window* _pParent,
78 const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxObjectModel,
79 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB
81 ~OEMPreloadDialog();
83 const String& GetAcceptString()const {return aAcceptST;}
84 const String GetCancelString() const {return aCancelPB.GetText();}
85 void SetCancelString( const String& rText );
87 static sal_Bool LoadFromLocalFile(const String& rFileName, String& rContent);
89 class OEMWelcomeTabPage : public TabPage
91 FixedText aInfoFT;
92 public:
93 OEMWelcomeTabPage(Window* pParent);
94 ~OEMWelcomeTabPage();
96 class LicenceView : public MultiLineEdit, public SfxListener
98 BOOL mbEndReached;
99 Link maEndReachedHdl;
100 Link maScrolledHdl;
102 public:
103 LicenceView( Window* pParent, const ResId& rResId );
104 ~LicenceView();
106 void ScrollDown( ScrollType eScroll );
108 BOOL IsEndReached() const;
109 BOOL EndReached() const { return mbEndReached; }
110 void SetEndReached( BOOL bEnd ) { mbEndReached = bEnd; }
112 void SetEndReachedHdl( const Link& rHdl ) { maEndReachedHdl = rHdl; }
113 const Link& GetAutocompleteHdl() const { return maEndReachedHdl; }
115 void SetScrolledHdl( const Link& rHdl ) { maScrolledHdl = rHdl; }
116 const Link& GetScrolledHdl() const { return maScrolledHdl; }
118 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
119 private:
120 using MultiLineEdit::Notify;
122 class OEMLicenseTabPage : public TabPage
124 LicenceView aLicenseML;
125 FixedText aInfo1FT;
126 FixedText aInfo2FT;
127 FixedText aInfo3FT;
128 FixedText aInfo2_1FT;
129 FixedText aInfo3_1FT;
130 CheckBox aCBAccept;
131 PushButton aPBPageDown;
132 FixedImage aArrow;
133 String aStrAccept;
134 String aStrNotAccept;
135 String aOldCancelText;
136 BOOL bEndReached;
138 OEMPreloadDialog* pPreloadDialog;
140 void EnableControls();
142 DECL_LINK( AcceptHdl, CheckBox * );
143 DECL_LINK( PageDownHdl, PushButton * );
144 DECL_LINK( EndReachedHdl, LicenceView * );
145 DECL_LINK( ScrolledHdl, LicenceView * );
147 public:
148 OEMLicenseTabPage(OEMPreloadDialog* pParent);
149 ~OEMLicenseTabPage();
151 virtual void ActivatePage();
154 //.........................................................................
155 } // namespace preload
156 //.........................................................................
158 #endif // _EXTENSIONS_PRELOAD_OEMWIZ_HXX_