xref: /trunk/main/sw/inc/inetfld.hxx (revision 1ecadb572e7010ff3b3382ad9bf179dbc6efadbb)
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 #ifndef SW_INETFLD_HXX
28 #define SW_INETFLD_HXX
29 
30 
31 #include "fldbas.hxx"
32 
33 class SvxMacro;
34 class SvxMacroTableDtor;
35 class SwINetField;
36 class SwCharFmt;
37 class SwDoc;
38 
39 /*--------------------------------------------------------------------
40     Beschreibung: InterNet-FieldType -> Lade Document mit der URL
41  --------------------------------------------------------------------*/
42 
43 class SwINetFieldType : public SwFieldType
44 {
45     SwDepend aNormalFmt;
46     SwDepend aVisitFmt;
47     SwDoc* pDoc;
48 
49 public:
50     SwINetFieldType( SwDoc* pDoc );
51 
52     virtual SwFieldType*    Copy() const;
53 
54     SwCharFmt*              GetCharFmt( const SwINetField& rFld );
55 
56     SwDoc* GetDoc() const   { return pDoc; }
57 };
58 
59 /*--------------------------------------------------------------------
60     Beschreibung: InterNet-Field -> Lade Document mit der URL
61  --------------------------------------------------------------------*/
62 
63 class SwINetField : public SwField
64 {
65     friend class SwINetFieldType;
66 
67     String  sTargetFrameName;   // in diesen Frame soll die URL
68     String  sURL;
69     String  sText;
70     SvxMacroTableDtor* pMacroTbl;
71 
72     virtual String   Expand() const;
73     virtual SwField* Copy() const;
74 
75 public:
76     // Direkte Eingabe alten Wert loeschen
77     SwINetField( SwINetFieldType* pTyp, sal_uInt16 nFmt,
78                   const String& rURL, const String& rText );
79     virtual ~SwINetField();
80 
81     virtual String   GetFieldName() const;
82 
83     // URL
84     virtual const String& GetPar1() const;
85     virtual void    SetPar1(const String& rStr);
86 
87     // HinweisText
88     virtual String  GetPar2() const;
89     virtual void    SetPar2(const String& rStr);
90 
91     // das ist das akt. Zeichenformat
92           SwCharFmt* GetCharFmt();
93     const SwCharFmt* GetCharFmt() const
94             { return ((SwINetField*)this)->GetCharFmt(); }
95 
96     const String& GetTargetFrameName() const        { return sTargetFrameName; }
97     void SetTargetFrameName( const String& rNm )    { sTargetFrameName = rNm; }
98 
99     // setze eine neue oder loesche die akt. MakroTabelle
100     void SetMacroTbl( const SvxMacroTableDtor* pTbl = 0 );
101     const SvxMacroTableDtor* GetMacroTbl() const    { return pMacroTbl; }
102 
103     // setze / erfrage ein Makro
104     void SetMacro( sal_uInt16 nEvent, const SvxMacro& rMacro );
105     const SvxMacro* GetMacro( sal_uInt16 nEvent ) const;
106 };
107 
108 
109 #endif // SW_INETFLD_HXX
110 
111