xref: /trunk/main/cui/source/dialogs/cuiimapwnd.cxx (revision cdf0e10c)
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 
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_cui.hxx"
30 
31 #include <tools/urlobj.hxx>
32 #include <vcl/msgbox.hxx>
33 #include <vcl/help.hxx>
34 #include <sfx2/sfxsids.hrc>
35 #define _ANIMATION
36 #include "macroass.hxx"
37 #include <svtools/imaprect.hxx>
38 #include <svtools/imapcirc.hxx>
39 #include <svtools/imappoly.hxx>
40 #include <svl/urlbmk.hxx>
41 #include <svx/xoutbmp.hxx>
42 #include <dialmgr.hxx>
43 #include <cuires.hrc>
44 #include <cuiimapdlg.hrc>
45 #include <cuiimapwnd.hxx>
46 #include <svx/svdpage.hxx>
47 #include <svx/svdorect.hxx>
48 #include <svx/svdocirc.hxx>
49 #include <svx/svdopath.hxx>
50 #include <svx/xfltrit.hxx>
51 #include <svx/svdpagv.hxx>
52 #include <svl/urihelper.hxx>
53 #include <svx/xfillit.hxx>
54 #include <svx/xlineit.hxx>
55 
56 #include <sot/formats.hxx>
57 
58 #define TRANSCOL Color( COL_WHITE )
59 
60 /*************************************************************************
61 |*
62 |*	URLDlg
63 |*
64 \************************************************************************/
65 
66 URLDlg::URLDlg( Window* pWindow, const String& rURL, const String& rAlternativeText, const String& rDescription, const String& rTarget, const String& rName, TargetList& rTargetList )
67 : ModalDialog( pWindow, CUI_RES( RID_SVXDLG_IMAPURL ) )
68 , maFtURL( this, CUI_RES( FT_URL1 ) )
69 , maEdtURL( this, CUI_RES( EDT_URL ) )
70 , maFtTarget( this, CUI_RES( FT_TARGET ) )
71 , maCbbTargets( this, CUI_RES( CBB_TARGETS ) )
72 , maFtName( this, CUI_RES( FT_NAME ) )
73 , maEdtName( this, CUI_RES( EDT_NAME ) )
74 , maFtAlternativeText( this, CUI_RES( FT_URLDESCRIPTION ) )
75 , maEdtAlternativeText( this, CUI_RES( EDT_URLDESCRIPTION ) )
76 , maFtDescription( this, CUI_RES( FT_DESCRIPTION ) )
77 , maEdtDescription( this, CUI_RES( EDT_DESCRIPTION ) )
78 , maFlURL( this, CUI_RES( FL_URL ) )
79 , maBtnHelp( this, CUI_RES( BTN_HELP1 ) )
80 , maBtnOk( this, CUI_RES( BTN_OK1 ) )
81 , maBtnCancel( this, CUI_RES( BTN_CANCEL1 ) )
82 {
83 	FreeResource();
84 
85 	maEdtURL.SetText( rURL );
86 	maEdtAlternativeText.SetText( rAlternativeText );
87 	maEdtDescription.SetText( rDescription );
88 	maEdtName.SetText( rName );
89 
90 	for( String* pStr = rTargetList.First(); pStr; pStr = rTargetList.Next() )
91 		maCbbTargets.InsertEntry( *pStr );
92 
93 	if( !rTarget.Len() )
94 		maCbbTargets.SetText( String::CreateFromAscii( "_self" ) );
95 	else
96 		maCbbTargets.SetText( rTarget );
97 }
98