2010-10-27 13:11:31 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-11-21 22:06:52 +00: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:07:07 +00:00
|
|
|
|
2013-10-23 19:08:11 +02:00
|
|
|
#ifndef INCLUDED_SVX_FONTLB_HXX
|
|
|
|
#define INCLUDED_SVX_FONTLB_HXX
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
#include <svtools/svtabbx.hxx>
|
2012-10-11 16:13:12 -04:00
|
|
|
#include <svtools/svlbitm.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <vcl/virdev.hxx>
|
2013-11-09 15:28:54 -06:00
|
|
|
#include <svx/svxdllapi.h>
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-02-25 19:06:16 +01:00
|
|
|
|
2002-07-23 09:52:55 +00:00
|
|
|
|
|
|
|
/** A list box string item which stores its text and font. */
|
2015-04-17 20:59:58 +01:00
|
|
|
class SAL_WARN_UNUSED SvLBoxFontString : public SvLBoxString
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2002-07-23 09:52:55 +00:00
|
|
|
private:
|
2014-09-16 10:09:58 +02:00
|
|
|
vcl::Font maFont; /// The font used by this item.
|
2002-07-23 09:52:55 +00:00
|
|
|
bool mbUseColor; /// true = use font color, false = default listbox color.
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
public:
|
2002-07-23 09:52:55 +00:00
|
|
|
SvLBoxFontString();
|
|
|
|
SvLBoxFontString(
|
2012-10-18 16:28:20 +02:00
|
|
|
SvTreeListEntry* pEntry,
|
2002-07-23 09:52:55 +00:00
|
|
|
sal_uInt16 nFlags,
|
2013-07-10 10:20:24 +01:00
|
|
|
const OUString& rString,
|
2014-09-16 10:09:58 +02:00
|
|
|
const vcl::Font& rFont,
|
2002-07-23 09:52:55 +00:00
|
|
|
const Color* pColor = NULL );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2002-07-23 09:52:55 +00:00
|
|
|
virtual ~SvLBoxFontString();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2002-07-23 09:52:55 +00:00
|
|
|
/** Creates a new empty list box item. */
|
2014-03-27 18:12:18 +01:00
|
|
|
virtual SvLBoxItem* Create() const SAL_OVERRIDE;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-03-27 18:12:18 +01:00
|
|
|
void InitViewData( SvTreeListBox*,SvTreeListEntry*,SvViewDataItem* ) SAL_OVERRIDE;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2002-07-23 09:52:55 +00:00
|
|
|
/** Paints this entry to the specified position, using the own font settings. */
|
2015-05-11 09:41:13 +09:00
|
|
|
virtual void Paint(const Point& rPos, SvTreeListBox& rOutDev, vcl::RenderContext& rRenderContext,
|
2015-06-10 21:32:54 +01:00
|
|
|
const SvViewDataEntry* pView, const SvTreeListEntry& rEntry) SAL_OVERRIDE;
|
2002-07-23 09:52:55 +00:00
|
|
|
};
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
2014-02-25 19:06:16 +01:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2002-07-23 09:52:55 +00:00
|
|
|
/** A list box supporting formatted string entries. */
|
2015-04-17 20:59:58 +01:00
|
|
|
class SVX_DLLPUBLIC SAL_WARN_UNUSED SvxFontListBox : public SvTabListBox
|
2002-07-23 09:52:55 +00:00
|
|
|
{
|
|
|
|
private:
|
2014-09-16 10:09:58 +02:00
|
|
|
vcl::Font maStdFont; /// Used for entries without specific font.
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2002-07-23 09:52:55 +00:00
|
|
|
// The following members are used to store additional parameters for InitEntry().
|
2014-09-16 10:09:58 +02:00
|
|
|
vcl::Font maEntryFont; /// Current entry font used in InitEntry().
|
2002-07-23 09:52:55 +00:00
|
|
|
const Color* mpEntryColor; /// Current entry color used in InitEntry().
|
|
|
|
bool mbUseFont; /// true = Use maEntryFont/mpEntryColor in InitEntry().
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2002-07-23 09:52:55 +00:00
|
|
|
public:
|
2014-09-23 11:20:40 +02:00
|
|
|
SvxFontListBox(vcl::Window* pParent, WinBits nStyle = WB_BORDER);
|
2002-07-23 09:52:55 +00:00
|
|
|
|
|
|
|
/** Inserts a list entry and sets the font used for this entry.
|
|
|
|
@param pColor The font color. NULL = use default listbox text color. */
|
|
|
|
void InsertFontEntry(
|
2014-09-16 10:09:58 +02:00
|
|
|
const OUString& rString, const vcl::Font& rFont, const Color* pColor = NULL );
|
2002-07-23 09:52:55 +00:00
|
|
|
|
|
|
|
/** Selects/deselects an entry specified by its position in the list box. */
|
2014-03-01 03:13:28 +01:00
|
|
|
void SelectEntryPos( sal_uLong nPos, bool bSelect = true );
|
2002-07-23 09:52:55 +00:00
|
|
|
/** Removes a selection. */
|
|
|
|
void SetNoSelection();
|
|
|
|
|
2015-05-11 09:41:13 +09:00
|
|
|
/** Returns the position of the entry currently selected or TREELIST_APPEND.
|
2014-03-01 03:13:28 +01:00
|
|
|
*/
|
2013-07-10 10:20:24 +01:00
|
|
|
sal_uLong GetSelectEntryPos() const;
|
2002-07-23 09:52:55 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
/** Initializes a new SvLBoxFontString entry.
|
|
|
|
@descr Uses current value of maEntryFont to set the entry font (if mbUseFont is true). */
|
|
|
|
virtual void InitEntry(
|
2012-10-18 16:28:20 +02:00
|
|
|
SvTreeListEntry* pEntry,
|
2012-10-25 11:26:43 +01:00
|
|
|
const OUString& rEntryText,
|
2002-07-23 09:52:55 +00:00
|
|
|
const Image& rCollImg,
|
2006-12-20 13:10:16 +00:00
|
|
|
const Image& rExpImg,
|
2014-03-27 18:12:18 +01:00
|
|
|
SvLBoxButtonKind eButtonKind) SAL_OVERRIDE;
|
2000-09-18 16:07:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
2002-07-23 09:52:55 +00:00
|
|
|
|
2010-10-27 13:11:31 +01:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|