• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KTextEditor

attribute.h

Go to the documentation of this file.
00001 /* This file is part of the KDE libraries
00002    Copyright (C) 2003-2005 Hamish Rodda <rodda@kde.org>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License version 2 as published by the Free Software Foundation.
00007 
00008    This library is distributed in the hope that it will be useful,
00009    but WITHOUT ANY WARRANTY; without even the implied warranty of
00010    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011    Library General Public License for more details.
00012 
00013    You should have received a copy of the GNU Library General Public License
00014    along with this library; see the file COPYING.LIB.  If not, write to
00015    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00016    Boston, MA 02110-1301, USA.
00017 */
00018 
00019 #ifndef KDELIBS_KTEXTEDITOR_ATTRIBUTE_H
00020 #define KDELIBS_KTEXTEDITOR_ATTRIBUTE_H
00021 
00022 #include <QtGui/QTextFormat>
00023 
00024 #include <ksharedptr.h>
00025 #include <ktexteditor/ktexteditor_export.h>
00026 
00027 class KAction;
00028 
00029 namespace KTextEditor
00030 {
00031 
00032 class SmartRange;
00033 
00059 class KTEXTEDITOR_EXPORT Attribute : public QTextCharFormat, public KShared
00060 {
00061   friend class SmartRange;
00062 
00063   public:
00064     typedef KSharedPtr<Attribute> Ptr;
00065 
00069     Attribute();
00070 
00074     Attribute(const Attribute& a);
00075 
00079     virtual ~Attribute();
00080 
00088     void changed() const;
00089 
00090     //BEGIN custom properties
00094     enum CustomProperties {
00096       Outline = QTextFormat::UserProperty,
00098       SelectedForeground,
00100       SelectedBackground,
00102       BackgroundFillWhitespace,
00104       AttributeDynamicEffect = 0x10A00,
00106       AttributeInternalProperty = 0x10E00,
00108       AttributeUserProperty = 0x110000
00109     };
00110 
00125     bool fontBold() const;
00126 
00134     void setFontBold(bool bold = true);
00135 
00141     QBrush outline() const;
00142 
00150     void setOutline(const QBrush& brush);
00151 
00157     QBrush selectedForeground() const;
00158 
00166     void setSelectedForeground(const QBrush& foreground);
00167 
00173     QBrush selectedBackground() const;
00174 
00182     void setSelectedBackground(const QBrush& brush);
00183 
00189     bool backgroundFillWhitespace() const;
00190 
00198     void setBackgroundFillWhitespace(bool fillWhitespace);
00199 
00200     // Fix deficiencies in QText{Char}Format
00204     void clear();
00205 
00211     bool hasAnyProperty() const;
00212     //END
00213 
00214     //BEGIN Action association
00233     void associateAction(KAction* action);
00234 
00241     void dissociateAction(KAction* action);
00242 
00246     const QList<KAction*>& associatedActions() const;
00247 
00251     void clearAssociatedActions();
00253     //END
00254 
00255     //BEGIN Dynamic highlighting
00261     enum ActivationType {
00263       ActivateMouseIn = 0,
00265       ActivateCaretIn
00266     };
00267 
00272     enum Effect {
00273       EffectNone          = 0x0 ,
00274       EffectFadeIn        = 0x1 ,
00275       EffectFadeOut       = 0x2 ,
00276       EffectPulse         = 0x4 ,
00277       EffectCycleGradient = 0x8 
00278     };
00279     Q_DECLARE_FLAGS(Effects, Effect)
00295     Attribute::Ptr dynamicAttribute(ActivationType type) const;
00296 
00305     void setDynamicAttribute(ActivationType type, Attribute::Ptr attribute);
00306 
00307     Effects effects() const;
00308     void setEffects(Effects effects);
00310     //END
00311 
00319     Attribute& operator+=(const Attribute& a);
00320 
00326     Attribute& operator=(const Attribute& a);
00327 
00328   protected:
00342   private:
00343     class AttributePrivate* const d;
00344 };
00345 
00346 Q_DECLARE_OPERATORS_FOR_FLAGS(Attribute::Effects)
00347 
00348 }
00349 
00350 #endif
00351 
00352 // kate: space-indent on; indent-width 2; replace-tabs on;

KTextEditor

Skip menu "KTextEditor"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal