fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / sw / inc / fmtfld.hxx
blob1ea8ccad663b1411ae02cb286549f683285e73b2
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef _FMTFLD_HXX
20 #define _FMTFLD_HXX
22 #include <list>
23 #include <svl/poolitem.hxx>
24 #include <svl/brdcst.hxx>
25 #include <svl/smplhint.hxx>
27 #include "swdllapi.h"
28 #include <calbck.hxx>
30 class SwField;
31 class SwTxtFld;
32 class SwView;
33 class SwFieldType;
35 // ATT_FLD
36 class SW_DLLPUBLIC SwFmtFld : public SfxPoolItem, public SwClient, public SfxBroadcaster
38 friend class SwTxtFld;
39 friend void _InitCore();
41 SwField *pField;
42 SwTxtFld* pTxtAttr;
44 SwFmtFld(); ///< Default attibute.
46 /* Protected CopyCtor.
47 @@@ copy construction allowed, but copy assignment is not? @@@ */
48 SwFmtFld& operator=(const SwFmtFld& rFld);
50 protected:
51 virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
52 virtual void SwClientNotify( const SwModify& rModify, const SfxHint& rHint );
54 public:
55 TYPEINFO();
57 /// Single argument constructors shall be explicit.
58 explicit SwFmtFld( const SwField &rFld );
60 /// @@@ copy construction allowed, but copy assignment is not? @@@
61 SwFmtFld( const SwFmtFld& rAttr );
63 virtual ~SwFmtFld();
65 /// "Pure virtual methods" of SfxPoolItem.
66 virtual int operator==( const SfxPoolItem& ) const;
67 virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
69 virtual bool GetInfo( SfxPoolItem& rInfo ) const;
71 const SwField *GetFld() const { return pField; }
72 SwField *GetFld() { return pField; }
74 /**
75 Sets current field.
77 @param pField new field
79 @attention The current field will be destroyed before setting the new field.
81 void SetFld(SwField * pField);
83 const SwTxtFld *GetTxtFld() const { return pTxtAttr; }
84 SwTxtFld *GetTxtFld() { return pTxtAttr; }
86 void RegisterToFieldType( SwFieldType& );
87 sal_Bool IsFldInDoc() const;
88 sal_Bool IsProtect() const;
91 class SW_DLLPUBLIC SwFmtFldHint : public SfxHint
93 #define SWFMTFLD_INSERTED 1
94 #define SWFMTFLD_REMOVED 2
95 #define SWFMTFLD_FOCUS 3
96 #define SWFMTFLD_CHANGED 4
97 #define SWFMTFLD_LANGUAGE 5
99 const SwFmtFld* pFld;
100 sal_Int16 nWhich;
101 const SwView* pView;
103 public:
104 SwFmtFldHint( const SwFmtFld* p, sal_Int16 n, const SwView* pV = 0)
105 : pFld(p)
106 , nWhich(n)
107 , pView(pV)
110 TYPEINFO();
111 const SwFmtFld* GetField() const { return pFld; }
112 sal_Int16 Which() const { return nWhich; }
113 const SwView* GetView() const { return pView; }
116 #endif
118 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */