• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdehtml
 

tdehtml

  • tdehtml
  • dom
css_value.h
1 /*
2  * This file is part of the DOM implementation for KDE.
3  *
4  * (C) 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 <tqcolor.h>
33 
34 #include <tdemacros.h>
35 
36 namespace DOM {
37 
38 class CSSStyleDeclarationImpl;
39 class CSSRule;
40 class CSSValue;
41 
60 class TDEHTML_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  DOM::DOMString getPropertyValue ( const DOM::DOMString &propertyName );
122 
142  CSSValue getPropertyCSSValue ( const DOM::DOMString &propertyName ) const;
143  CSSValue getPropertyCSSValue ( const DOM::DOMString &propertyName );
144 
163  DOM::DOMString removeProperty ( const DOM::DOMString &propertyName );
164 
179  DOM::DOMString getPropertyPriority ( const DOM::DOMString &propertyName ) const;
180  DOM::DOMString getPropertyPriority ( const DOM::DOMString &propertyName );
181 
206  void setProperty ( const DOM::DOMString &propertyName, const DOM::DOMString &value, const DOM::DOMString &priority );
207 
221  DOM::DOMString item ( unsigned long index ) const;
222  DOM::DOMString item ( unsigned long index );
223 
228  CSSStyleDeclarationImpl *handle() const;
229  bool isNull() const;
230 
231 protected:
232  CSSStyleDeclarationImpl *impl;
233 };
234 
235 
236 class CSSValueImpl;
237 
243 class TDEHTML_EXPORT CSSValue
244 {
245 public:
246  CSSValue();
247  CSSValue(const CSSValue &other);
248  CSSValue(CSSValueImpl *impl);
249 public:
250 
251  CSSValue & operator = (const CSSValue &other);
252 
253  ~CSSValue();
261  enum UnitTypes {
262  CSS_INHERIT = 0,
263  CSS_PRIMITIVE_VALUE = 1,
264  CSS_VALUE_LIST = 2,
265  CSS_CUSTOM = 3,
266  CSS_INITIAL = 4
267  };
268 
273  DOM::DOMString cssText() const;
274 
286  void setCssText( const DOM::DOMString & );
287 
292  unsigned short cssValueType() const;
293 
298  bool isCSSValueList() const;
299  bool isCSSPrimitiveValue() const;
300  CSSValueImpl *handle() const;
301  bool isNull() const;
302 
303 protected:
304  CSSValueImpl *impl;
305 };
306 
307 
308 class CSSValueListImpl;
309 class CSSValue;
310 
316 class TDEHTML_EXPORT CSSValueList : public CSSValue
317 {
318 public:
319  CSSValueList();
320  CSSValueList(const CSSValueList &other);
321  CSSValueList(const CSSValue &other);
322  CSSValueList(CSSValueListImpl *impl);
323 public:
324 
325  CSSValueList & operator = (const CSSValueList &other);
326  CSSValueList & operator = (const CSSValue &other);
327 
328  ~CSSValueList();
329 
336  unsigned long length() const;
337 
350  CSSValue item ( unsigned long index );
351 
352 protected:
353  CSSValueListImpl *vimpl;
354 };
355 
356 
357 class CSSPrimitiveValueImpl;
358 class Counter;
359 class RGBColor;
360 class Rect;
361 
373 class TDEHTML_EXPORT CSSPrimitiveValue : public CSSValue
374 {
375 public:
376  CSSPrimitiveValue();
377  CSSPrimitiveValue(const CSSPrimitiveValue &other);
378  CSSPrimitiveValue(const CSSValue &other);
379  CSSPrimitiveValue(CSSPrimitiveValueImpl *impl);
380 public:
381 
382  CSSPrimitiveValue & operator = (const CSSPrimitiveValue &other);
383  CSSPrimitiveValue & operator = (const CSSValue &other);
384 
385  ~CSSPrimitiveValue();
390  enum UnitTypes {
391  CSS_UNKNOWN = 0,
392  CSS_NUMBER = 1,
393  CSS_PERCENTAGE = 2,
394  CSS_EMS = 3,
395  CSS_EXS = 4,
396  CSS_PX = 5,
397  CSS_CM = 6,
398  CSS_MM = 7,
399  CSS_IN = 8,
400  CSS_PT = 9,
401  CSS_PC = 10,
402  CSS_DEG = 11,
403  CSS_RAD = 12,
404  CSS_GRAD = 13,
405  CSS_MS = 14,
406  CSS_S = 15,
407  CSS_HZ = 16,
408  CSS_KHZ = 17,
409  CSS_DIMENSION = 18,
410  CSS_STRING = 19,
411  CSS_URI = 20,
412  CSS_IDENT = 21,
413  CSS_ATTR = 22,
414  CSS_COUNTER = 23,
415  CSS_RECT = 24,
416  CSS_RGBCOLOR = 25,
417  CSS_PAIR = 100, // We envision this being exposed as a means of getting computed style values for pairs
418  CSS_HTML_RELATIVE = 255
419  };
420 
426  unsigned short primitiveType() const;
427 
456  void setFloatValue ( unsigned short unitType, float floatValue );
457 
483  // ### KDE 4: make this const!
484  float getFloatValue ( unsigned short unitType );
485 
511  void setStringValue ( unsigned short stringType, const DOM::DOMString &stringValue );
512 
528  // ### KDE4: make this const!
529  DOM::DOMString getStringValue ( );
530 
544  // ### KDE4: make this const!
545  Counter getCounterValue ( );
546 
560  // ### KDE4: make this const!
561  Rect getRectValue ( );
562 
577  // ### KDE4: make this const!
578  RGBColor getRGBColorValue ( );
579 };
580 
581 
582 
591 class TDEHTML_EXPORT RGBColor
592 {
593 public:
594  RGBColor();
598  RGBColor(const TQColor& c) { m_color = c.rgb(); }
599  RGBColor(TQRgb color);
600 
601  RGBColor(const RGBColor &other);
602  RGBColor & operator = (const RGBColor &other);
603 
604  ~RGBColor();
605 
610  CSSPrimitiveValue red() const;
611 
616  CSSPrimitiveValue green() const;
617 
622  CSSPrimitiveValue blue() const;
623 
627  TQRgb color() const { return m_color; }
628 protected:
629  TQRgb m_color;
630 };
631 
632 class RectImpl;
633 
642 class TDEHTML_EXPORT Rect
643 {
644  friend class CSSPrimitiveValue;
645 public:
646  Rect();
647  Rect(const Rect &other);
648 
649  Rect & operator = (const Rect &other);
650 
651  ~Rect();
652 
657  CSSPrimitiveValue top() const;
658 
663  CSSPrimitiveValue right() const;
664 
669  CSSPrimitiveValue bottom() const;
670 
675  CSSPrimitiveValue left() const;
676 
681  RectImpl *handle() const;
682  bool isNull() const;
683 
684 protected:
685  RectImpl *impl;
686  Rect(RectImpl *i);
687 };
688 
689 class CounterImpl;
690 
699 class TDEHTML_EXPORT Counter
700 {
701  friend class CSSPrimitiveValue;
702 public:
703  Counter();
704  Counter(const Counter &other);
705 public:
706 
707  Counter & operator = (const Counter &other);
708 
709  ~Counter();
710 
715  DOM::DOMString identifier() const;
716 
721  DOM::DOMString listStyle() const;
722 
727  DOM::DOMString separator() const;
728 
733  CounterImpl *handle() const;
734  bool isNull() const;
735 
736 protected:
737  CounterImpl *impl;
738  Counter(CounterImpl *i);
739 };
740 
741 
742 } // namespace
743 
744 
745 #endif
DOM::CSSPrimitiveValue
The CSSPrimitiveValue interface represents a single CSS value .
Definition: css_value.h:374
DOM::CSSRule
The CSSRule interface is the abstract base interface for any type of CSS statement .
Definition: css_rule.h:53
DOM::CSSStyleDeclaration
The CSSStyleDeclaration interface represents a single CSS declaration block .
Definition: css_value.h:61
DOM::CSSValueList
The CSSValueList interface provides the absraction of an ordered collection of CSS values.
Definition: css_value.h:317
DOM::CSSValue
The CSSValue interface represents a simple or a complexe value.
Definition: css_value.h:244
DOM::CSSValue::UnitTypes
UnitTypes
An integer indicating which type of unit applies to the value.
Definition: css_value.h:261
DOM::Counter
The Counter interface is used to represent any counter or counters function value.
Definition: css_value.h:700
DOM::DOMString
This class implements the basic string we use in the DOM.
Definition: dom_string.h:44
DOM::RGBColor
The RGBColor interface is used to represent any RGB color value.
Definition: css_value.h:592
DOM::RGBColor::RGBColor
RGBColor(const TQColor &c)
Definition: css_value.h:598
DOM::Rect
The Rect interface is used to represent any rect value.
Definition: css_value.h:643
DOM
The Document Object Model (DOM) is divided into two parts, the COREDOM core DOM, specifying some core...
Definition: design.h:57

tdehtml

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

tdehtml

Skip menu "tdehtml"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdehtml by doxygen 1.9.1
This website is maintained by Timothy Pearson.