Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 : #ifndef _UNOTOOLS_HXX
20 : #define _UNOTOOLS_HXX
21 :
22 :
23 : #include <vcl/button.hxx>
24 : #include <vcl/edit.hxx>
25 : #include <vcl/dialog.hxx>
26 : #include <vcl/fixed.hxx>
27 : #include <vcl/layout.hxx>
28 : #include <actctrl.hxx>
29 : #include <com/sun/star/frame/XController.hpp>
30 : #include <com/sun/star/text/XTextCursor.hpp>
31 : #include <com/sun/star/container/XNameAccess.hpp>
32 : #include <com/sun/star/awt/XControl.hpp>
33 : #include <com/sun/star/container/XNamed.hpp>
34 : #include <tools/resary.hxx>
35 : #include "swdllapi.h"
36 :
37 : class SwOneExampleFrame;
38 :
39 0 : class SwFrmCtrlWindow : public VclEventBox
40 : {
41 : SwOneExampleFrame* pExampleFrame;
42 : public:
43 : SwFrmCtrlWindow(Window* pParent, SwOneExampleFrame* pFrame);
44 :
45 : virtual void Command( const CommandEvent& rCEvt );
46 : virtual Size GetOptimalSize() const;
47 : virtual void Resize();
48 : };
49 :
50 0 : class MenuResource : public Resource
51 : {
52 : ResStringArray aMenuArray;
53 :
54 : public:
55 : MenuResource(const ResId& rResId);
56 :
57 0 : ResStringArray& GetMenuArray() {return aMenuArray;}
58 : };
59 :
60 : #define EX_SHOW_ONLINE_LAYOUT 0x001
61 :
62 : // hard zoom value
63 : #define EX_SHOW_BUSINESS_CARDS 0x02
64 : //don't modify page size
65 : #define EX_SHOW_DEFAULT_PAGE 0x04
66 :
67 : class SwView;
68 :
69 : class SW_DLLPUBLIC SwOneExampleFrame
70 : {
71 : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > _xControl;
72 : ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > _xModel;
73 : ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController > _xController;
74 : ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > _xCursor;
75 :
76 : SwFrmCtrlWindow aTopWindow;
77 : Timer aLoadedTimer;
78 : Link aInitializedLink;
79 :
80 : MenuResource aMenuRes;
81 : String sArgumentURL;
82 :
83 : SwView* pModuleView;
84 :
85 : sal_uInt32 nStyleFlags;
86 :
87 : sal_Bool bIsInitialized;
88 : sal_Bool bServiceAvailable;
89 :
90 : static bool bShowServiceNotAvailableMessage;
91 :
92 : SW_DLLPRIVATE DECL_LINK( TimeoutHdl, Timer* );
93 : SW_DLLPRIVATE DECL_LINK( PopupHdl, Menu* );
94 :
95 : SW_DLLPRIVATE void CreateControl();
96 : SW_DLLPRIVATE void DisposeControl();
97 :
98 : public:
99 : SwOneExampleFrame(Window& rWin,
100 : sal_uInt32 nStyleFlags = EX_SHOW_ONLINE_LAYOUT,
101 : const Link* pInitalizedLink = 0,
102 : String* pURL = 0);
103 : ~SwOneExampleFrame();
104 :
105 : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > & GetControl() {return _xControl; }
106 0 : ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & GetModel() {return _xModel;}
107 0 : ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController > & GetController() {return _xController;}
108 0 : ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > & GetTextCursor() {return _xCursor;}
109 :
110 : void ClearDocument( sal_Bool bStartTimer = sal_False );
111 :
112 0 : sal_Bool IsInitialized() const {return bIsInitialized;}
113 0 : sal_Bool IsServiceAvailable() const {return bServiceAvailable;}
114 :
115 : void CreatePopup(const Point& rPt);
116 :
117 : static void CreateErrorMessage(Window* pParent);
118 : };
119 :
120 : #endif
121 :
122 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|