2010-10-27 13:11:31 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-21 14:30:25 +01: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 .
|
|
|
|
*/
|
2004-06-28 13:02:27 +00:00
|
|
|
|
2013-10-23 19:08:11 +02:00
|
|
|
#ifndef INCLUDED_SVX_SWFRAMEEXAMPLE_HXX
|
|
|
|
#define INCLUDED_SVX_SWFRAMEEXAMPLE_HXX
|
2004-06-28 13:02:27 +00:00
|
|
|
|
|
|
|
#include <vcl/window.hxx>
|
|
|
|
#include <tools/color.hxx>
|
|
|
|
#include <tools/gen.hxx>
|
2013-11-09 15:28:54 -06:00
|
|
|
#include <svx/svxdllapi.h>
|
2005-01-21 14:35:56 +00:00
|
|
|
|
2004-06-28 13:02:27 +00:00
|
|
|
// class SwFrmPagePreview -------------------------------------------------------
|
|
|
|
|
2014-09-23 11:20:40 +02:00
|
|
|
class SVX_DLLPUBLIC SvxSwFrameExample : public vcl::Window
|
2004-06-28 13:02:27 +00:00
|
|
|
{
|
|
|
|
Color m_aTransColor; // transparency
|
|
|
|
Color m_aBgCol; // background
|
|
|
|
Color m_aFrameColor; // graphic frame
|
|
|
|
Color m_aAlignColor; // align anchor
|
|
|
|
Color m_aBorderCol; // frame of doc
|
|
|
|
Color m_aPrintAreaCol; // frame of printable area of doc
|
|
|
|
Color m_aTxtCol; // symbolised text
|
|
|
|
Color m_aBlankCol; // area of symbol for blank
|
|
|
|
Color m_aBlankFrameCol; // frame of symbol for blank
|
|
|
|
|
|
|
|
Rectangle aPage;
|
|
|
|
Rectangle aPagePrtArea;
|
|
|
|
Rectangle aTextLine;
|
|
|
|
Rectangle aPara;
|
|
|
|
Rectangle aParaPrtArea;
|
|
|
|
Rectangle aFrameAtFrame;
|
|
|
|
Rectangle aDrawObj;
|
|
|
|
Rectangle aAutoCharFrame;
|
|
|
|
Size aFrmSize;
|
|
|
|
|
|
|
|
short nHAlign;
|
|
|
|
short nHRel;
|
|
|
|
|
|
|
|
short nVAlign;
|
|
|
|
short nVRel;
|
|
|
|
|
|
|
|
short nWrap;
|
|
|
|
short nAnchor;
|
2014-03-10 14:58:41 +02:00
|
|
|
bool bTrans;
|
2004-06-28 13:02:27 +00:00
|
|
|
|
|
|
|
Point aRelPos;
|
|
|
|
|
2015-04-14 12:44:47 +02:00
|
|
|
void InitColors_Impl();
|
2015-05-13 10:30:04 +09:00
|
|
|
void InitAllRects_Impl(vcl::RenderContext& rRenderContext);
|
2004-06-28 13:02:27 +00:00
|
|
|
void CalcBoundRect_Impl(Rectangle &rRect);
|
2015-05-13 10:30:04 +09:00
|
|
|
Rectangle DrawInnerFrame_Impl(vcl::RenderContext& rRenderContext, const Rectangle &rRect, const Color &rFillColor, const Color &rBorderColor);
|
2004-06-28 13:02:27 +00:00
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void Paint(vcl::RenderContext& rRenderContext, const Rectangle&) override;
|
|
|
|
virtual Size GetOptimalSize() const override;
|
2004-06-28 13:02:27 +00:00
|
|
|
protected:
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
|
2004-06-28 13:02:27 +00:00
|
|
|
public:
|
|
|
|
|
2014-09-23 11:20:40 +02:00
|
|
|
SvxSwFrameExample(vcl::Window* pParent, WinBits nStyle);
|
2004-06-28 13:02:27 +00:00
|
|
|
|
2017-03-03 20:57:02 +01:00
|
|
|
void SetWrap(sal_uInt16 nW) { nWrap = nW; }
|
2004-06-28 13:02:27 +00:00
|
|
|
|
2017-03-03 20:57:02 +01:00
|
|
|
void SetHAlign(short nH) { nHAlign = nH; }
|
|
|
|
void SetHoriRel(short nR) { nHRel = nR; }
|
2004-06-28 13:02:27 +00:00
|
|
|
|
2017-03-03 20:57:02 +01:00
|
|
|
void SetVAlign(short nV) { nVAlign = nV; }
|
|
|
|
void SetVertRel(short nR) { nVRel = nR; }
|
2004-06-28 13:02:27 +00:00
|
|
|
|
2017-03-03 20:57:02 +01:00
|
|
|
void SetTransparent(bool bT) { bTrans = bT; }
|
|
|
|
void SetAnchor(short nA) { nAnchor = nA; }
|
2004-06-28 13:02:27 +00:00
|
|
|
|
|
|
|
void SetRelPos(const Point& rP);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2013-10-23 19:08:11 +02:00
|
|
|
#endif // INCLUDED_SVX_SWFRAMEEXAMPLE_HXX
|
2010-10-27 13:11:31 +01:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|