2010-10-14 08:30:41 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2011-03-31 10:05:04 +02:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2013-11-05 02:17:53 +01:00
|
|
|
#ifndef INCLUDED_SW_INC_DDEFLD_HXX
|
|
|
|
#define INCLUDED_SW_INC_DDEFLD_HXX
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2004-10-04 17:57:37 +00:00
|
|
|
#include <sfx2/lnkbase.hxx>
|
2004-08-23 07:29:49 +00:00
|
|
|
#include "swdllapi.h"
|
2000-09-18 16:15:01 +00:00
|
|
|
#include "fldbas.hxx"
|
|
|
|
|
|
|
|
class SwDoc;
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
2011-01-10 15:26:51 +01:00
|
|
|
FieldType for DDE
|
2000-09-18 16:15:01 +00:00
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
2004-08-23 07:29:49 +00:00
|
|
|
class SW_DLLPUBLIC SwDDEFieldType : public SwFieldType
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString aName;
|
2013-07-14 15:21:18 +02:00
|
|
|
OUString aExpansion;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2004-10-04 17:57:37 +00:00
|
|
|
::sfx2::SvBaseLinkRef refLink;
|
2000-09-18 16:15:01 +00:00
|
|
|
SwDoc* pDoc;
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nRefCnt;
|
|
|
|
sal_Bool bCRLFFlag : 1;
|
|
|
|
sal_Bool bDeleted : 1;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2014-02-03 14:43:37 +01:00
|
|
|
SAL_DLLPRIVATE void _RefCntChgd();
|
2004-08-23 07:29:49 +00:00
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
public:
|
2013-07-14 15:21:18 +02:00
|
|
|
SwDDEFieldType( const OUString& rName, const OUString& rCmd,
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 = sfx2::LINKUPDATE_ONCALL );
|
2014-04-01 19:18:35 +02:00
|
|
|
virtual ~SwDDEFieldType();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2013-07-14 15:21:18 +02:00
|
|
|
OUString GetExpansion() const { return aExpansion; }
|
|
|
|
void SetExpansion( const OUString& rStr ) { aExpansion = rStr;
|
2011-01-17 15:06:54 +01:00
|
|
|
bCRLFFlag = sal_False; }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2014-03-27 18:12:18 +01:00
|
|
|
virtual SwFieldType* Copy() const SAL_OVERRIDE;
|
|
|
|
virtual OUString GetName() const SAL_OVERRIDE;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2014-03-27 18:12:18 +01:00
|
|
|
virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const SAL_OVERRIDE;
|
|
|
|
virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) SAL_OVERRIDE;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2013-07-14 15:21:18 +02:00
|
|
|
OUString GetCmd() const;
|
2014-03-17 09:14:55 +02:00
|
|
|
void SetCmd( const OUString& aStr );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 GetType() const { return refLink->GetUpdateMode(); }
|
|
|
|
void SetType( sal_uInt16 nType ) { refLink->SetUpdateMode( nType ); }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool IsDeleted() const { return bDeleted; }
|
|
|
|
void SetDeleted( sal_Bool b ) { bDeleted = b; }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
void UpdateNow() { refLink->Update(); }
|
|
|
|
void Disconnect() { refLink->Disconnect(); }
|
|
|
|
|
2004-10-04 17:57:37 +00:00
|
|
|
const ::sfx2::SvBaseLink& GetBaseLink() const { return *refLink; }
|
|
|
|
::sfx2::SvBaseLink& GetBaseLink() { return *refLink; }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
const SwDoc* GetDoc() const { return pDoc; }
|
|
|
|
SwDoc* GetDoc() { return pDoc; }
|
|
|
|
void SetDoc( SwDoc* pDoc );
|
|
|
|
|
|
|
|
void IncRefCnt() { if( !nRefCnt++ && pDoc ) _RefCntChgd(); }
|
|
|
|
void DecRefCnt() { if( !--nRefCnt && pDoc ) _RefCntChgd(); }
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
void SetCRLFDelFlag( sal_Bool bFlag = sal_True ) { bCRLFFlag = bFlag; }
|
2000-09-18 16:15:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
2011-01-10 15:26:51 +01:00
|
|
|
DDE-field
|
2000-09-18 16:15:01 +00:00
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
class SwDDEField : public SwField
|
|
|
|
{
|
2010-10-04 17:14:34 +02:00
|
|
|
private:
|
2014-03-27 18:12:18 +01:00
|
|
|
virtual OUString Expand() const SAL_OVERRIDE;
|
|
|
|
virtual SwField* Copy() const SAL_OVERRIDE;
|
2010-10-04 17:14:34 +02:00
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
public:
|
|
|
|
SwDDEField(SwDDEFieldType*);
|
2014-04-01 19:18:35 +02:00
|
|
|
virtual ~SwDDEField();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2012-08-01 16:10:20 +03:00
|
|
|
/** Get parameter via types.
|
|
|
|
Name cannot be changed. */
|
2014-03-27 18:12:18 +01:00
|
|
|
virtual OUString GetPar1() const SAL_OVERRIDE;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2011-01-10 15:26:51 +01:00
|
|
|
// Command
|
2014-03-27 18:12:18 +01:00
|
|
|
virtual OUString GetPar2() const SAL_OVERRIDE;
|
|
|
|
virtual void SetPar2(const OUString& rStr) SAL_OVERRIDE;
|
2000-09-18 16:15:01 +00:00
|
|
|
};
|
|
|
|
|
2013-11-05 02:17:53 +01:00
|
|
|
#endif // INCLUDED_SW_INC_DDEFLD_HXX
|
2010-10-14 08:30:41 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|