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

KHTML

  • sources
  • kde-4.12
  • kdelibs
  • khtml
  • dom
css_value.h
Go to the documentation of this file.
1 /*
2  * This file is part of the DOM implementation for KDE.
3  *
4  * Copyright 1999 Lars Knoll (knoll@kde.org)
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public License
17  * along with this library; see the file COPYING.LIB. If not, write to
18  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  *
21  * This file includes excerpts from the Document Object Model (DOM)
22  * Level 2 Specification (Style)
23  * http://www.w3.org/TR/DOM-Level-2-Style/
24  * Copyright © 2000 W3C® (MIT, INRIA, Keio), All Rights Reserved.
25  *
26  */
27 #ifndef _CSS_css_value_h_
28 #define _CSS_css_value_h_
29 
30 #include <dom/dom_string.h>
31 
32 #include <QtGui/QColor>
33 
34 #include <kdemacros.h>
35 
36 namespace DOM {
37 
38 class CSSStyleDeclarationImpl;
39 class CSSRule;
40 class CSSValue;
41 
60 class KHTML_EXPORT CSSStyleDeclaration
61 {
62 public:
63  CSSStyleDeclaration();
64  CSSStyleDeclaration(const CSSStyleDeclaration &other);
65  CSSStyleDeclaration(CSSStyleDeclarationImpl *impl);
66 public:
67 
68  CSSStyleDeclaration & operator = (const CSSStyleDeclaration &other);
69 
70  ~CSSStyleDeclaration();
71 
79  DOM::DOMString cssText() const;
80 
92  void setCssText( const DOM::DOMString & );
93 
99  unsigned long length() const;
100 
105  CSSRule parentRule() const;
106 
120  DOM::DOMString getPropertyValue ( const DOM::DOMString &propertyName ) const;
121 
141  CSSValue getPropertyCSSValue ( const DOM::DOMString &propertyName ) const;
142 
161  DOM::DOMString removeProperty ( const DOM::DOMString &propertyName );
162 
177  DOM::DOMString getPropertyPriority ( const DOM::DOMString &propertyName ) const;
178 
203  void setProperty ( const DOM::DOMString &propertyName, const DOM::DOMString &value, const DOM::DOMString &priority );
204 
218  DOM::DOMString item ( unsigned long index ) const;
219  DOM::DOMString item ( unsigned long index ); // ### KDE5: remove
220 
225  CSSStyleDeclarationImpl *handle() const;
226  bool isNull() const;
227 
228 protected:
229  CSSStyleDeclarationImpl *impl;
230 };
231 
232 
233 class CSSValueImpl;
234 
240 class KHTML_EXPORT CSSValue
241 {
242 public:
243  CSSValue();
244  CSSValue(const CSSValue &other);
245  CSSValue(CSSValueImpl *impl);
246 public:
247 
248  CSSValue & operator = (const CSSValue &other);
249 
250  ~CSSValue();
258  enum UnitTypes {
259  CSS_INHERIT = 0,
260  CSS_PRIMITIVE_VALUE = 1,
261  CSS_VALUE_LIST = 2,
262  CSS_CUSTOM = 3,
263  CSS_INITIAL = 4,
264 
265  CSS_SVG_VALUE = 1001
266  };
267 
272  DOM::DOMString cssText() const;
273 
285  void setCssText( const DOM::DOMString & );
286 
291  unsigned short cssValueType() const;
292 
297  bool isCSSValueList() const;
298  bool isCSSPrimitiveValue() const;
299  CSSValueImpl *handle() const;
300  bool isNull() const;
301 
302 protected:
303  CSSValueImpl *impl;
304 };
305 
306 
307 class CSSValueListImpl;
308 class CSSValue;
309 
315 class KHTML_EXPORT CSSValueList : public CSSValue
316 {
317 public:
318  CSSValueList();
319  CSSValueList(const CSSValueList &other);
320  CSSValueList(const CSSValue &other);
321  CSSValueList(CSSValueListImpl *impl);
322 public:
323 
324  CSSValueList & operator = (const CSSValueList &other);
325  CSSValueList & operator = (const CSSValue &other);
326 
327  ~CSSValueList();
328 
335  unsigned long length() const;
336 
349  CSSValue item ( unsigned long index );
350 
351 protected:
352  CSSValueListImpl *vimpl;
353 };
354 
355 
356 class CSSPrimitiveValueImpl;
357 class Counter;
358 class RGBColor;
359 class Rect;
360 
372 class KHTML_EXPORT CSSPrimitiveValue : public CSSValue
373 {
374 public:
375  CSSPrimitiveValue();
376  CSSPrimitiveValue(const CSSPrimitiveValue &other);
377  CSSPrimitiveValue(const CSSValue &other);
378  CSSPrimitiveValue(CSSPrimitiveValueImpl *impl);
379 public:
380 
381  CSSPrimitiveValue & operator = (const CSSPrimitiveValue &other);
382  CSSPrimitiveValue & operator = (const CSSValue &other);
383 
384  ~CSSPrimitiveValue();
389  enum UnitTypes {
390  CSS_UNKNOWN = 0,
391  CSS_NUMBER = 1,
392  CSS_PERCENTAGE = 2,
393  CSS_EMS = 3,
394  CSS_EXS = 4,
395  CSS_PX = 5,
396  CSS_CM = 6,
397  CSS_MM = 7,
398  CSS_IN = 8,
399  CSS_PT = 9,
400  CSS_PC = 10,
401  CSS_DEG = 11,
402  CSS_RAD = 12,
403  CSS_GRAD = 13,
404  CSS_MS = 14,
405  CSS_S = 15,
406  CSS_HZ = 16,
407  CSS_KHZ = 17,
408  CSS_DIMENSION = 18,
409  CSS_STRING = 19,
410  CSS_URI = 20,
411  CSS_IDENT = 21,
412  CSS_ATTR = 22,
413  CSS_COUNTER = 23,
414  CSS_RECT = 24,
415  CSS_RGBCOLOR = 25,
416  CSS_DPI = 26,
417  CSS_DPCM = 27,
418  CSS_PAIR = 100, // We envision this being exposed as a means of getting computed style values for pairs
419  CSS_HTML_RELATIVE = 255
420  };
421 
427  unsigned short primitiveType() const;
428 
457  void setFloatValue ( unsigned short unitType, float floatValue );
458 
484  float getFloatValue ( unsigned short unitType ) const;
485 
511  void setStringValue ( unsigned short stringType, const DOM::DOMString &stringValue );
512 
528  DOM::DOMString getStringValue ( ) const;
529 
543  Counter getCounterValue ( ) const;
544 
558  Rect getRectValue ( ) const;
559 
574  RGBColor getRGBColorValue ( ) const;
575 };
576 
577 
578 
587 class KHTML_EXPORT RGBColor
588 {
589 public:
590  RGBColor();
594  RGBColor(const QColor& c) { m_color = c.rgb(); }
595  RGBColor(QRgb color);
596 
597  RGBColor(const RGBColor &other);
598  RGBColor & operator = (const RGBColor &other);
599 
600  ~RGBColor();
601 
606  CSSPrimitiveValue red() const;
607 
612  CSSPrimitiveValue green() const;
613 
618  CSSPrimitiveValue blue() const;
619 
623  QRgb color() const { return m_color; }
624 protected:
625  QRgb m_color;
626 };
627 
628 class RectImpl;
629 
638 class KHTML_EXPORT Rect
639 {
640  friend class CSSPrimitiveValue;
641 public:
642  Rect();
643  Rect(const Rect &other);
644 
645  Rect & operator = (const Rect &other);
646 
647  ~Rect();
648 
653  CSSPrimitiveValue top() const;
654 
659  CSSPrimitiveValue right() const;
660 
665  CSSPrimitiveValue bottom() const;
666 
671  CSSPrimitiveValue left() const;
672 
677  RectImpl *handle() const;
678  bool isNull() const;
679 
680 protected:
681  RectImpl *impl;
682  Rect(RectImpl *i);
683 };
684 
685 class CounterImpl;
686 
695 class KHTML_EXPORT Counter
696 {
697  friend class CSSPrimitiveValue;
698 public:
699  Counter();
700  Counter(const Counter &other);
701 public:
702 
703  Counter & operator = (const Counter &other);
704 
705  ~Counter();
706 
711  DOM::DOMString identifier() const;
712 
717  DOM::DOMString listStyle() const;
718 
723  DOM::DOMString separator() const;
724 
729  CounterImpl *handle() const;
730  bool isNull() const;
731 
732 protected:
733  CounterImpl *impl;
734  Counter(CounterImpl *i);
735 };
736 
737 
738 } // namespace
739 
740 
741 #endif
dom_string.h
DOM::CSSStyleDeclaration::impl
CSSStyleDeclarationImpl * impl
Definition: css_value.h:229
QColor
DOM::CSSValue::UnitTypes
UnitTypes
An integer indicating which type of unit applies to the value.
Definition: css_value.h:258
DOM::CSSStyleDeclaration
The CSSStyleDeclaration interface represents a single CSS declaration block .
Definition: css_value.h:60
DOM::CSSValueList::vimpl
CSSValueListImpl * vimpl
Definition: css_value.h:352
DOM::RGBColor::color
QRgb color() const
Definition: css_value.h:623
DOM::CSSValueList
The CSSValueList interface provides the absraction of an ordered collection of CSS values...
Definition: css_value.h:315
DOM::CSSPrimitiveValue
The CSSPrimitiveValue interface represents a single CSS value .
Definition: css_value.h:372
khtml::XPath::stringValue
DOMString stringValue(NodeImpl *node)
Definition: util.cpp:68
DOM::DOMString
This class implements the basic string we use in the DOM.
Definition: dom_string.h:43
DOM::Counter::impl
CounterImpl * impl
Definition: css_value.h:733
DOM::Rect::impl
RectImpl * impl
Definition: css_value.h:681
DOM::RGBColor::RGBColor
RGBColor(const QColor &c)
Definition: css_value.h:594
DOM::Rect
The Rect interface is used to represent any rect value.
Definition: css_value.h:638
DOM::RGBColor::m_color
QRgb m_color
Definition: css_value.h:625
DOM::CSSRule
The CSSRule interface is the abstract base interface for any type of CSS statement ...
Definition: css_rule.h:52
DOM::RGBColor
The RGBColor interface is used to represent any RGB color value.
Definition: css_value.h:587
DOM::CSSValue::impl
CSSValueImpl * impl
Definition: css_value.h:303
DOM::CSSValue
The CSSValue interface represents a simple or a complexe value.
Definition: css_value.h:240
DOM::Counter
The Counter interface is used to represent any counter or counters function value.
Definition: css_value.h:695
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:51:20 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KHTML

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

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal