update dev300-m58
[ooovba.git] / sw / source / ui / inc / unotools.hxx
blob4ce0a550d4fea89aa40afa52ead8bd335e8ecfbd
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: unotools.hxx,v $
10 * $Revision: 1.13 $
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 ************************************************************************/
30 #ifndef _UNOTOOLS_HXX
31 #define _UNOTOOLS_HXX
34 #include <vcl/dialog.hxx>
35 #include <vcl/fixed.hxx>
36 #include <vcl/edit.hxx>
37 #ifndef _SV_BUTTON_HXX //autogen
38 #include <vcl/button.hxx>
39 #endif
40 #include <actctrl.hxx>
41 #include <com/sun/star/frame/XController.hpp>
42 #include <com/sun/star/text/XTextCursor.hpp>
43 #include <com/sun/star/container/XNameAccess.hpp>
44 #include <com/sun/star/awt/XControl.hpp>
45 #include <com/sun/star/container/XNamed.hpp>
46 #include <tools/resary.hxx>
47 #include <swunodef.hxx>
48 #include "swdllapi.h"
50 /* -----------------------------15.12.99 09:55--------------------------------
52 ---------------------------------------------------------------------------*/
53 class SwOneExampleFrame;
54 class SwFrmCtrlWindow : public Window
56 SwOneExampleFrame* pExampleFrame;
57 public:
58 SwFrmCtrlWindow(Window* pParent, WinBits nBits, SwOneExampleFrame* pFrame);
60 virtual void Command( const CommandEvent& rCEvt );
62 /* -----------------------------15.12.99 12:56--------------------------------
64 ---------------------------------------------------------------------------*/
65 class MenuResource : public Resource
67 ResStringArray aMenuArray;
69 public:
70 MenuResource(const ResId& rResId);
72 ResStringArray& GetMenuArray() {return aMenuArray;}
74 /* -----------------27.07.99 15:20-------------------
76 --------------------------------------------------*/
77 #define EX_SHOW_ONLINE_LAYOUT 0x001
79 // hard zoom value
80 #define EX_SHOW_BUSINESS_CARDS 0x02
81 //don't modify page size
82 #define EX_SHOW_DEFAULT_PAGE 0x04
84 class SwView;
85 class SW_DLLPUBLIC SwOneExampleFrame
87 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > _xControl;
88 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > _xModel;
89 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController > _xController;
90 ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > _xCursor;
92 SwFrmCtrlWindow aTopWindow;
93 Window& rWindow;
94 Timer aLoadedTimer;
95 Link aInitializedLink;
97 MenuResource aMenuRes;
98 String sArgumentURL;
100 SwView* pModuleView;
102 sal_uInt32 nStyleFlags;
104 sal_Bool bIsInitialized;
105 sal_Bool bServiceAvailable;
107 static sal_Bool bShowServiceNotAvailableMessage;
109 SW_DLLPRIVATE DECL_LINK( TimeoutHdl, Timer* );
110 SW_DLLPRIVATE DECL_LINK( PopupHdl, Menu* );
112 SW_DLLPRIVATE void CreateControl();
113 SW_DLLPRIVATE void DisposeControl();
115 public:
116 SwOneExampleFrame(Window& rWin,
117 sal_uInt32 nStyleFlags = EX_SHOW_ONLINE_LAYOUT,
118 const Link* pInitalizedLink = 0,
119 String* pURL = 0);
120 ~SwOneExampleFrame();
122 STAR_REFERENCE( awt::XControl ) & GetControl() {return _xControl; }
123 STAR_REFERENCE( frame::XModel ) & GetModel() {return _xModel;}
124 STAR_REFERENCE( frame::XController ) & GetController() {return _xController;}
125 STAR_REFERENCE( text::XTextCursor ) & GetTextCursor() {return _xCursor;}
127 void ClearDocument( BOOL bStartTimer = FALSE );
129 sal_Bool IsInitialized() const {return bIsInitialized;}
130 sal_Bool IsServiceAvailable() const {return bServiceAvailable;}
132 void CreatePopup(const Point& rPt);
134 static void CreateErrorMessage(Window* pParent);
137 #endif