merge the formfield patch from ooo-build
[ooovba.git] / svx / source / cui / hltpbase.hxx
blob6a8ed9a0309ec8575ee68f1132a39ef99a4474ee
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: hltpbase.hxx,v $
10 * $Revision: 1.8.216.1 $
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 _SVX_TABBASE_HYPERLINK_HXX
31 #define _SVX_TABBASE_HYPERLINK_HXX
33 #define INET_TELNET_SCHEME "telnet://"
35 #include <sfx2/app.hxx>
36 #include <sfx2/tabdlg.hxx>
37 #include <vcl/group.hxx>
38 #ifndef _SV_BUTTON_HXX
39 #include <vcl/button.hxx>
40 #endif
41 #include <vcl/fixed.hxx>
42 #include <vcl/combobox.hxx>
43 #include <vcl/edit.hxx>
44 #include <vcl/lstbox.hxx>
45 #include <tools/urlobj.hxx>
46 #include <svtools/stritem.hxx>
47 #include <svtools/eitem.hxx>
48 #include <svtools/transfer.hxx>
49 #include <sfx2/dispatch.hxx>
50 #include <vcl/msgbox.hxx>
51 #include <sfx2/fcontnr.hxx>
52 #include <svtools/inettbc.hxx>
53 #include <vcl/timer.hxx>
55 #include <svx/dialmgr.hxx>
56 #include <sfx2/docfile.hxx>
57 #include <svx/dialogs.hrc>
59 #include <com/sun/star/frame/XFrame.hpp>
61 #ifndef _SVX_HELPID_HRC
62 #include "helpid.hrc"
63 #endif
65 #include "hlnkitem.hxx"
67 #include "hlmarkwn.hxx"
68 #include "iconcdlg.hxx"
71 /*************************************************************************
73 |* ComboBox-Control, wich is filled with all current framenames
75 \************************************************************************/
77 class SvxFramesComboBox : public ComboBox
79 public:
80 SvxFramesComboBox (Window* pParent, const ResId& rResId, SfxDispatcher* pDispatch);
81 ~SvxFramesComboBox ();
84 /*************************************************************************
86 |* ComboBox-Control for URL's with History and Autocompletion
88 \************************************************************************/
90 class SvxHyperURLBox : public SvtURLBox, public DropTargetHelper
92 private:
93 BOOL mbAccessAddress;
95 // String GetAllEmailNamesFromDragItem( USHORT nItem );
97 protected:
99 virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
100 virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt );
102 virtual long Notify( NotifyEvent& rNEvt );
103 virtual void Select();
104 virtual void Modify();
105 virtual long PreNotify( NotifyEvent& rNEvt );
107 public:
108 SvxHyperURLBox( Window* pParent, INetProtocol eSmart = INET_PROT_FILE, BOOL bAddresses = FALSE );
112 /*************************************************************************
114 |* Tabpage : Basisclass
116 \************************************************************************/
118 class SvxHyperlinkTabPageBase : public IconChoicePage
120 private:
121 FixedLine *mpGrpMore;
122 FixedText *mpFtFrame;
123 SvxFramesComboBox *mpCbbFrame;
124 FixedText *mpFtForm;
125 ListBox *mpLbForm;
126 FixedText *mpFtIndication;
127 Edit *mpEdIndication;
128 FixedText *mpFtText;
129 Edit *mpEdText;
130 ImageButton *mpBtScript;
132 sal_Bool mbIsCloseDisabled;
134 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >
135 mxDocumentFrame;
137 protected:
138 Window* mpDialog;
140 BOOL mbStdControlsInit;
142 String maStrInitURL;
144 Timer maTimer;
146 SvxHlinkDlgMarkWnd* mpMarkWnd;
148 void InitStdControls ();
149 virtual void FillStandardDlgFields ( SvxHyperlinkItem* pHyperlinkItem );
150 virtual void FillDlgFields ( String& aStrURL ) = 0;
151 virtual void GetCurentItemData ( String& aStrURL, String& aStrName,
152 String& aStrIntName, String& aStrFrame,
153 SvxLinkInsertMode& eMode ) = 0;
154 virtual String CreateUiNameFromURL( const String& aStrURL );
156 void GetDataFromCommonFields( String& aStrName,
157 String& aStrIntName, String& aStrFrame,
158 SvxLinkInsertMode& eMode );
160 DECL_LINK (ClickScriptHdl_Impl, void * ); // Button : Script
162 String aEmptyStr;
164 BOOL FileExists( const INetURLObject& rURL );
165 static String GetSchemeFromURL( String aStrURL );
167 inline void DisableClose( sal_Bool _bDisable ) { mbIsCloseDisabled = _bDisable; }
169 public:
170 SvxHyperlinkTabPageBase (
171 Window *pParent,
172 const ResId &rResId,
173 const SfxItemSet& rItemSet
175 virtual ~SvxHyperlinkTabPageBase ();
177 void SetDocumentFrame(
178 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxDocumentFrame )
180 mxDocumentFrame = rxDocumentFrame;
183 virtual BOOL AskApply ();
184 virtual void DoApply ();
185 virtual void SetOnlineMode( BOOL bEnable );
186 virtual void SetInitFocus();
187 virtual void SetMarkStr ( String& aStrMark );
188 virtual void Reset( const SfxItemSet& );
189 virtual BOOL FillItemSet( SfxItemSet& );
190 virtual void ActivatePage( const SfxItemSet& rItemSet );
191 virtual int DeactivatePage( SfxItemSet* pSet = 0 );
193 BOOL IsMarkWndVisible () { return ((Window*)mpMarkWnd)->IsVisible(); }
194 Size GetSizeExtraWnd () { return ( mpMarkWnd->GetSizePixel() ); }
195 BOOL MoveToExtraWnd ( Point aNewPos, BOOL bDisConnectDlg = FALSE );
197 virtual void ActivatePage();
198 virtual void DeactivatePage();
199 virtual sal_Bool QueryClose();
201 protected:
202 virtual BOOL ShouldOpenMarkWnd();
203 virtual void SetMarkWndShouldOpen(BOOL bOpen);
205 void ShowMarkWnd ();
206 void HideMarkWnd () { ( ( Window* ) mpMarkWnd )->Hide(); }
207 void InvalidateMarkWnd () { ( ( Window* ) mpMarkWnd )->Invalidate(); }
209 SfxDispatcher* GetDispatcher() const;
211 USHORT GetMacroEvents();
212 SvxMacroTableDtor* GetMacroTable();
214 BOOL IsHTMLDoc() const;
217 #endif // _SVX_TABBASE_HYPERLINK_HXX