Update ooo320-m1
[ooovba.git] / svx / source / cui / cuiimapwnd.cxx
blob72147f49e614eb041cd50353aa043c524d9343c5
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: cuiimapwnd.cxx,v $
10 * $Revision: 1.12 $
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 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_svx.hxx"
34 #ifdef SVX_DLLIMPLEMENTATION
35 #undef SVX_DLLIMPLEMENTATION
36 #endif
37 #include <tools/urlobj.hxx>
38 #include <vcl/msgbox.hxx>
39 #include <vcl/help.hxx>
40 #include <sfx2/sfxsids.hrc> // SID_ATTR_MACROITEM
41 #define _ANIMATION
42 #include "macroass.hxx"
43 #include <svtools/imaprect.hxx>
44 #include <svtools/imapcirc.hxx>
45 #include <svtools/imappoly.hxx>
46 #include <svtools/urlbmk.hxx>
48 #include <xoutbmp.hxx>
49 #include <svx/dialmgr.hxx>
50 #include <svx/dialogs.hrc>
51 #include <svx/svxids.hrc>
52 #include <cuiimapdlg.hrc>
53 #include <cuiimapwnd.hxx>
54 #include <svx/svdpage.hxx>
55 #include <svx/svdorect.hxx>
56 #include <svx/svdocirc.hxx>
57 #include <svx/svdopath.hxx>
58 #include <svx/xfltrit.hxx>
59 #include <svx/svdpagv.hxx>
60 #include <svtools/urihelper.hxx>
61 #include <svx/xfillit.hxx>
62 #include <svx/xlineit.hxx>
64 #include <sot/formats.hxx>
66 #define TRANSCOL Color( COL_WHITE )
68 /*************************************************************************
70 |* URLDlg
72 \************************************************************************/
74 URLDlg::URLDlg( Window* pWindow, const String& rURL, const String& rAlternativeText, const String& rDescription, const String& rTarget, const String& rName, TargetList& rTargetList )
75 : ModalDialog( pWindow, SVX_RES( RID_SVXDLG_IMAPURL ) )
76 , maFtURL( this, SVX_RES( FT_URL1 ) )
77 , maEdtURL( this, SVX_RES( EDT_URL ) )
78 , maFtTarget( this, SVX_RES( FT_TARGET ) )
79 , maCbbTargets( this, SVX_RES( CBB_TARGETS ) )
80 , maFtName( this, SVX_RES( FT_NAME ) )
81 , maEdtName( this, SVX_RES( EDT_NAME ) )
82 , maFtAlternativeText( this, SVX_RES( FT_URLDESCRIPTION ) )
83 , maEdtAlternativeText( this, SVX_RES( EDT_URLDESCRIPTION ) )
84 , maFtDescription( this, SVX_RES( FT_DESCRIPTION ) )
85 , maEdtDescription( this, SVX_RES( EDT_DESCRIPTION ) )
86 , maFlURL( this, SVX_RES( FL_URL ) )
87 , maBtnHelp( this, SVX_RES( BTN_HELP1 ) )
88 , maBtnOk( this, SVX_RES( BTN_OK1 ) )
89 , maBtnCancel( this, SVX_RES( BTN_CANCEL1 ) )
91 FreeResource();
93 maEdtURL.SetText( rURL );
94 maEdtAlternativeText.SetText( rAlternativeText );
95 maEdtDescription.SetText( rDescription );
96 maEdtName.SetText( rName );
98 for( String* pStr = rTargetList.First(); pStr; pStr = rTargetList.Next() )
99 maCbbTargets.InsertEntry( *pStr );
101 if( !rTarget.Len() )
102 maCbbTargets.SetText( String::CreateFromAscii( "_self" ) );
103 else
104 maCbbTargets.SetText( rTarget );