1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef __LICENSEDLG_HXX__
28 #define __LICENSEDLG_HXX__
29 
30 #include <sal/types.h>
31 #include <rtl/string.hxx>
32 #include <rtl/ustring.hxx>
33 #include <rtl/ustrbuf.hxx>
34 #include <tools/string.hxx>
35 #include <tools/resmgr.hxx>
36 #include <vcl/button.hxx>
37 #include <vcl/edit.hxx>
38 #include <vcl/fixed.hxx>
39 #include <vcl/dialog.hxx>
40 #include <vcl/scrbar.hxx>
41 #include <svtools/svmedit.hxx>
42 #include <svl/lstner.hxx>
43 
44 namespace framework {
45 
46 class LicenseView : public MultiLineEdit, public SfxListener
47 {
48     sal_Bool            mbEndReached;
49     Link            maEndReachedHdl;
50     Link            maScrolledHdl;
51 
52 public:
53     LicenseView( Window* pParent, const ResId& rResId );
54     ~LicenseView();
55 
56     void ScrollDown( ScrollType eScroll );
57 
58     sal_Bool IsEndReached() const;
59     sal_Bool EndReached() const { return mbEndReached; }
60     void SetEndReached( sal_Bool bEnd ) { mbEndReached = bEnd; }
61 
62     void SetEndReachedHdl( const Link& rHdl )  { maEndReachedHdl = rHdl; }
63     const Link& GetAutocompleteHdl() const { return maEndReachedHdl; }
64 
65     void SetScrolledHdl( const Link& rHdl )  { maScrolledHdl = rHdl; }
66     const Link& GetScrolledHdl() const { return maScrolledHdl; }
67 
68     using MultiLineEdit::Notify;
69     virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
70 };
71 
72 class LicenseDialog : public ModalDialog
73 {
74     LicenseView     aLicenseML;
75     FixedText       aInfo1FT;
76     FixedText       aInfo2FT;
77     FixedText       aInfo3FT;
78     FixedText       aInfo2_1FT;
79     FixedText       aInfo3_1FT;
80     FixedLine       aFixedLine;
81     PushButton      aPBPageDown;
82     PushButton      aPBDecline;
83     PushButton      aPBAccept;
84     FixedImage      aArrow;
85     String          aStrAccept;
86     String          aStrNotAccept;
87     String          aOldCancelText;
88     sal_Bool            bEndReached;
89 
90     void                EnableControls();
91 
92     DECL_LINK(          PageDownHdl, PushButton * );
93     DECL_LINK(          EndReachedHdl, LicenseView * );
94     DECL_LINK(          ScrolledHdl, LicenseView * );
95     DECL_LINK(          AcceptBtnHdl, PushButton * );
96     DECL_LINK(          DeclineBtnHdl, PushButton * );
97 
98     public:
99         LicenseDialog(const rtl::OUString& aLicense, ResMgr *pResMgr);
100         virtual ~LicenseDialog();
101 
102 };
103 }
104 #endif
105