2014-05-27 09:03:51 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/*
|
|
|
|
* 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/.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef INCLUDED_SW_INC_TEXTBOXHELPER_HXX
|
|
|
|
#define INCLUDED_SW_INC_TEXTBOXHELPER_HXX
|
|
|
|
|
2014-05-27 09:06:11 +02:00
|
|
|
#include <list>
|
|
|
|
|
2014-05-27 09:03:51 +02:00
|
|
|
#include <com/sun/star/uno/Any.h>
|
|
|
|
#include <com/sun/star/uno/Type.h>
|
2014-05-27 09:06:29 +02:00
|
|
|
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
|
2014-05-27 09:03:51 +02:00
|
|
|
|
2014-05-27 09:06:11 +02:00
|
|
|
class SdrPage;
|
2014-05-27 09:03:51 +02:00
|
|
|
class SwFrmFmt;
|
2014-05-27 09:06:11 +02:00
|
|
|
class SwDoc;
|
2014-05-28 15:35:33 +02:00
|
|
|
class Rectangle;
|
2014-05-27 09:03:51 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* A TextBox is a TextFrame, that is tied to a drawinglayer shape.
|
|
|
|
*
|
|
|
|
* This class provides helper methods to create, query and maintain such
|
|
|
|
* TextBoxes.
|
|
|
|
*/
|
|
|
|
class SwTextBoxHelper
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/// Create a TextBox for a shape.
|
|
|
|
static void create(SwFrmFmt* pShape);
|
2014-05-27 09:05:36 +02:00
|
|
|
/// Destroy a TextBox for a shape.
|
|
|
|
static void destroy(SwFrmFmt* pShape);
|
2014-05-27 09:05:55 +02:00
|
|
|
/// Get interface of a shape's TextBox, if there is any.
|
|
|
|
static css::uno::Any queryInterface(SwFrmFmt* pShape, const css::uno::Type& rType);
|
2014-05-27 09:03:51 +02:00
|
|
|
/// Sync property of TextBox with the one of the shape.
|
|
|
|
static void syncProperty(SwFrmFmt* pShape, sal_uInt16 nWID, sal_uInt8 nMemberID, const OUString& rPropertyName, const css::uno::Any& rValue);
|
2014-05-27 09:04:57 +02:00
|
|
|
/// If we have an associated TextFrame, then return that.
|
|
|
|
static SwFrmFmt* findTextBox(SwFrmFmt* pShape);
|
2014-05-28 15:35:33 +02:00
|
|
|
/// Return the textbox rectangle of a draw shape (absolute values, in twips).
|
|
|
|
static Rectangle getTextRectangle(SwFrmFmt* pShape);
|
2014-05-27 09:06:11 +02:00
|
|
|
|
|
|
|
/// Look up TextFrames in a document, which are in fact TextBoxes.
|
2014-05-27 09:07:06 +02:00
|
|
|
static std::list<SwFrmFmt*> findTextBoxes(const SwDoc* pDoc);
|
2014-05-27 09:06:11 +02:00
|
|
|
/// Count number of shapes in the document, excluding TextBoxes.
|
|
|
|
static sal_Int32 getCount(SdrPage* pPage, std::list<SwFrmFmt*>& rTextBoxes);
|
2014-05-27 09:06:29 +02:00
|
|
|
/// Get a shape by index, excluding TextBoxes.
|
|
|
|
static css::uno::Any getByIndex(SdrPage* pPage, sal_Int32 nIndex, std::list<SwFrmFmt*>& rTextBoxes) throw(css::lang::IndexOutOfBoundsException);
|
2014-05-27 09:03:51 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // INCLUDED_SW_INC_TEXTBOXHELPER_HXX
|
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|