xref: /aoo42x/main/sw/inc/inetfld.hxx (revision 1d2dbeb0)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef SW_INETFLD_HXX
24 #define SW_INETFLD_HXX
25 
26 
27 #include "fldbas.hxx"
28 
29 class SvxMacro;
30 class SvxMacroTableDtor;
31 class SwINetField;
32 class SwCharFmt;
33 class SwDoc;
34 
35 /*--------------------------------------------------------------------
36 	Beschreibung: InterNet-FieldType -> Lade Document mit der URL
37  --------------------------------------------------------------------*/
38 
39 class SwINetFieldType : public SwFieldType
40 {
41 	SwDepend aNormalFmt;
42 	SwDepend aVisitFmt;
43 	SwDoc* pDoc;
44 
45 public:
46 	SwINetFieldType( SwDoc* pDoc );
47 
48 	virtual SwFieldType*    Copy() const;
49 
50 	SwCharFmt* 				GetCharFmt( const SwINetField& rFld );
51 
GetDoc() const52 	SwDoc* GetDoc() const	{ return pDoc; }
53 };
54 
55 /*--------------------------------------------------------------------
56 	Beschreibung: InterNet-Field -> Lade Document mit der URL
57  --------------------------------------------------------------------*/
58 
59 class SwINetField : public SwField
60 {
61 	friend class SwINetFieldType;
62 
63 	String	sTargetFrameName;	// in diesen Frame soll die URL
64 	String  sURL;
65 	String  sText;
66 	SvxMacroTableDtor* pMacroTbl;
67 
68 	virtual String	 Expand() const;
69 	virtual SwField* Copy() const;
70 
71 public:
72 	// Direkte Eingabe alten Wert loeschen
73 	SwINetField( SwINetFieldType* pTyp, sal_uInt16 nFmt,
74 				  const String& rURL, const String& rText );
75 	virtual	~SwINetField();
76 
77     virtual String   GetFieldName() const;
78 
79 	// URL
80 	virtual const String& GetPar1() const;
81 	virtual void	SetPar1(const String& rStr);
82 
83 	// HinweisText
84 	virtual String	GetPar2() const;
85 	virtual void	SetPar2(const String& rStr);
86 
87 	// das ist das akt. Zeichenformat
88 		  SwCharFmt* GetCharFmt();
GetCharFmt() const89 	const SwCharFmt* GetCharFmt() const
90 			{ return ((SwINetField*)this)->GetCharFmt(); }
91 
GetTargetFrameName() const92 	const String& GetTargetFrameName() const 		{ return sTargetFrameName; }
SetTargetFrameName(const String & rNm)93 	void SetTargetFrameName( const String& rNm )	{ sTargetFrameName = rNm; }
94 
95 	// setze eine neue oder loesche die akt. MakroTabelle
96 	void SetMacroTbl( const SvxMacroTableDtor* pTbl = 0 );
GetMacroTbl() const97 	const SvxMacroTableDtor* GetMacroTbl() const	{ return pMacroTbl; }
98 
99 	// setze / erfrage ein Makro
100 	void SetMacro( sal_uInt16 nEvent, const SvxMacro& rMacro );
101 	const SvxMacro* GetMacro( sal_uInt16 nEvent ) const;
102 };
103 
104 
105 #endif // SW_INETFLD_HXX
106 
107