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 .
|
|
|
|
*/
|
2000-09-18 16:15:01 +00:00
|
|
|
#ifndef _GLOSHDL_HXX
|
|
|
|
#define _GLOSHDL_HXX
|
|
|
|
|
|
|
|
#include <tools/string.hxx>
|
2004-08-23 07:59:28 +00:00
|
|
|
#include "swdllapi.h"
|
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
class SwWrtShell;
|
|
|
|
class SwTextBlocks;
|
|
|
|
class SvxMacro;
|
|
|
|
class SwGlossaries;
|
|
|
|
class SfxViewFrame;
|
|
|
|
|
|
|
|
// CLASS -----------------------------------------------------------------
|
2004-08-23 07:59:28 +00:00
|
|
|
class SW_DLLPUBLIC SwGlossaryHdl
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
SwGlossaries& rStatGlossaries;
|
|
|
|
String aCurGrp;
|
|
|
|
SfxViewFrame* pViewFrame;
|
|
|
|
SwWrtShell* pWrtShell;
|
|
|
|
SwTextBlocks* pCurGrp;
|
|
|
|
|
2004-08-23 07:59:28 +00:00
|
|
|
SW_DLLPRIVATE void _SetMacros(const String &rName,
|
2000-09-18 16:15:01 +00:00
|
|
|
const SvxMacro *pStart,
|
|
|
|
const SvxMacro *pEnd);
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
SW_DLLPRIVATE sal_Bool Expand( const String& rShortName,
|
2000-09-18 16:15:01 +00:00
|
|
|
SwGlossaries* pGlossaries,
|
2008-02-04 14:35:06 +00:00
|
|
|
SwTextBlocks *pGlossary );
|
2004-08-23 07:59:28 +00:00
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
public:
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool ConvertToNew(SwTextBlocks& rOld);
|
2000-09-18 16:15:01 +00:00
|
|
|
void GlossaryDlg();
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 GetGroupCnt() const;
|
|
|
|
String GetGroupName( sal_uInt16, String* pTitle = 0 );
|
|
|
|
sal_Bool NewGroup(String & rGroupName, const String& rTitle);
|
|
|
|
sal_Bool DelGroup(const String &);
|
|
|
|
sal_Bool RenameGroup(const String & rOld, String& rNew, const String& rNewTitle);
|
|
|
|
void SetCurGroup(const String &aGrp, sal_Bool bApi = sal_False, sal_Bool bAlwaysCreateNew = sal_False);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
const String &GetCurGroup() const { return aCurGrp; }
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 GetGlossaryCnt();
|
|
|
|
String GetGlossaryName(sal_uInt16);
|
2000-09-18 16:15:01 +00:00
|
|
|
String GetGlossaryShortName(const String &rName);
|
2011-01-17 15:06:54 +01:00
|
|
|
String GetGlossaryShortName(sal_uInt16);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool Rename( const String& rOldShortName, const String& rNewShortName,
|
2000-09-18 16:15:01 +00:00
|
|
|
const String& rNewName);
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool CopyOrMove( const String& rSourceGroupName, String& rSourceShortName,
|
|
|
|
const String& rDestGroupName, const String& rLongName, sal_Bool bMove );
|
|
|
|
sal_Bool HasShortName(const String &rShortName) const;
|
2011-04-21 18:12:29 +02:00
|
|
|
// when NewGlossary is called from Basic then the previously set group should
|
|
|
|
// be newly created if applicable.
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool NewGlossary(const String &rName, const String &rShortName,
|
|
|
|
sal_Bool bApiCall = sal_False, sal_Bool bNoAttr = sal_False );
|
|
|
|
sal_Bool DelGlossary(const String&);
|
|
|
|
sal_Bool CopyToClipboard(SwWrtShell& rSh, const String& rShortName);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool ExpandGlossary();
|
2012-10-28 23:38:30 +09:00
|
|
|
bool InsertGlossary(const String &rName);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
void SetMacros(const String& rName,
|
|
|
|
const SvxMacro* pStart,
|
|
|
|
const SvxMacro* pEnd,
|
|
|
|
SwTextBlocks *pGlossary = 0 );
|
|
|
|
void GetMacros(const String& rShortName,
|
|
|
|
SvxMacro& rStart,
|
|
|
|
SvxMacro& rEnd,
|
|
|
|
SwTextBlocks* pGlossary = 0 );
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool IsReadOnly( const String* = 0 ) const;
|
|
|
|
sal_Bool IsOld() const;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2011-04-21 18:12:29 +02:00
|
|
|
sal_Bool FindGroupName(String & rGroup); // find group without path index
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool ImportGlossaries( const String& rName );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
SwGlossaryHdl(SfxViewFrame* pViewFrame, SwWrtShell *);
|
|
|
|
~SwGlossaryHdl();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _GLOSHDL_HXX
|
2010-10-14 08:30:41 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|