API  1.0.0
CPTheme Class Reference

#import <CPTheme.h>

+ Inheritance diagram for CPTheme:

Instance Methods

(CPDictionary- attributeNamesForClass:
 
(CPDictionary- attributesForClass:
 
(_CPThemeAttribute) - attributeWithName:forClass:
 
(CPArray) - classNames
 
(void) - encodeWithCoder:
 
(id) - initWithCoder:
 
(id) - initWithName:
 
(BOOL) - isCSSBased
 
(CPString- name
 
(void) - setCSSResourcesPath:
 
(void) - takeThemeFromObject:
 
(id) - valueForAttributeWithName:forClass:
 
(id) - valueForAttributeWithName:inState:forClass:
 
- Instance Methods inherited from CPObject
(void) - addObserver:forKeyPath:options:context:
 
(void) - applyChange:toKeyPath:
 
(id) - autorelease
 
(id) - awakeAfterUsingCoder:
 
(void) - awakeFromCib
 
(void) - bind:toObject:withKeyPath:options:
 
(Class) - classForCoder
 
(Class) - classForKeyedArchiver
 
(CPString- className
 
(id) - copy
 
(void) - dealloc
 
(CPString- description
 
(CPDictionary- dictionaryWithValuesForKeys:
 
(void) - didChange:valuesAtIndexes:forKey:
 
(void) - didChangeValueForKey:
 
(void) - didChangeValueForKey:withSetMutation:usingObjects:
 
(void) - doesNotRecognizeSelector:
 
(CPArray) - exposedBindings
 
(id) - forwardingTargetForSelector:
 
(void) - forwardInvocation:
 
(unsigned) - hash
 
(BOOL) - implementsSelector:
 
(CPDictionary- infoForBinding:
 
(id) - init
 
(BOOL) - isEqual:
 
(BOOL) - isKindOfClass:
 
(BOOL) - isMemberOfClass:
 
(BOOL) - isProxy
 
(IMP) - methodForSelector:
 
(CPMethodSignature) - methodSignatureForSelector:
 
(id) - mutableArrayValueForKey:
 
(id) - mutableArrayValueForKeyPath:
 
(id) - mutableCopy
 
(id) - mutableSetValueForKey:
 
(id) - mutableSetValueForKeyPath:
 
(id) - performSelector:
 
(id) - performSelector:withObject:
 
(void) - performSelector:withObject:afterDelay:
 
(void) - performSelector:withObject:afterDelay:inModes:
 
(id) - performSelector:withObject:withObject:
 
(id) - performSelector:withObjects:
 
(void) - release
 
(void) - removeObserver:forKeyPath:
 
(id) - replacementObjectForArchiver:
 
(id) - replacementObjectForCoder:
 
(id) - replacementObjectForKeyedArchiver:
 
(BOOL) - respondsToSelector:
 
(id) - retain
 
(id) - self
 
(void) - setValue:forKey:
 
(void) - setValue:forKeyPath:
 
(void) - setValue:forUndefinedKey:
 
(void) - setValuesForKeysWithDictionary:
 
(CPString- UID
 
(void) - unbind:
 
(Class) - valueClassForBinding:
 
(id) - valueForKey:
 
(id) - valueForKeyPath:
 
(id) - valueForUndefinedKey:
 
(void) - willChange:valuesAtIndexes:forKey:
 
(void) - willChangeValueForKey:
 
(void) - willChangeValueForKey:withSetMutation:usingObjects:
 

Class Methods

(CPTheme+ defaultHudTheme
 
(CPTheme+ defaultTheme
 
(void) + setDefaultHudTheme:
 
(void) + setDefaultTheme:
 
(CPTheme+ themeNamed:
 
- Class Methods inherited from CPObject
(BOOL) + accessInstanceVariablesDirectly
 
(id) + alloc
 
(id) + allocWithCoder:
 
(BOOL) + automaticallyNotifiesObserversForKey:
 
(void) + cancelPreviousPerformRequestsWithTarget:
 
(void) + cancelPreviousPerformRequestsWithTarget:selector:object:
 
(Class) + class
 
(BOOL) + conformsToProtocol:
 
(void) + exposeBinding:
 
(void) + initialize
 
(IMP) + instanceMethodForSelector:
 
(BOOL) + instancesImplementSelector:
 
(BOOL) + instancesRespondToSelector:
 
(BOOL) + isBindingExclusive:
 
(BOOL) + isSubclassOfClass:
 
(CPSet) + keyPathsForValuesAffectingValueForKey:
 
(void) + load
 
(id) + new
 
(void) + object:performSelector:withObject:afterDelay:inModes:
 
(void) + setVersion:
 
(Class) + superclass
 
(int) + version
 

Detailed Description

Definition at line 2 of file CPTheme.h.

Method Documentation

◆ attributeNamesForClass:()

- (CPDictionary) attributeNamesForClass: (id)  aClass
implementation

Returns an array of names of all theme attributes defined for the given class, as found in the theme's ThemeDescriptors.j file.

The aClass parameter can be one of the following:

  • A class instance, for example the result of [CPCheckBox class]. The class must be a subclass of CPView.
  • A class name, for example "CPCheckBox".
  • A themed class name, for example "check-box".

If aClass does not refer to a themed class in this theme, nil is returned.

Parameters
aClassThe themed class whose attributes you want to retrieve
Returns
An array of attribute names or nil

Definition at line 172 of file CPTheme.j.

◆ attributesForClass:()

- (CPDictionary) attributesForClass: (id)  aClass
implementation

Returns a dictionary of all theme attributes defined for the given class, as found in the theme's ThemeDescriptors.j file. The keys of the dictionary are attribute names, and the values are instances of _CPThemeAttribute.

For a description of valid values for aClass, see attributeNamesForClass:.

Parameters
aClassThe themed class whose attributes you want to retrieve
Returns
A dictionary of attributes or nil

Definition at line 118 of file CPTheme.j.

◆ attributeWithName:forClass:()

- (_CPThemeAttribute) attributeWithName: (CPString aName
forClass: (id)  aClass 
implementation

Returns a theme attribute defined for the given class, as found in the theme's ThemeDescriptors.j file.

aName should be the attribute name as you would pass to the method CPView::valueForThemeAttribute:.

For a description of valid values for aClass, see attributeNamesForClass:.

Parameters
aNameThe name of the attribute you want to retrieve
aClassThe themed class in which to look for the attribute
Returns
An instance of _CPThemeAttribute or nil

Definition at line 195 of file CPTheme.j.

◆ classNames()

- (CPArray) classNames
implementation

Returns an array of names of themed classes defined in this theme, as found in its ThemeDescriptors.j file.

NOTE: The names are not class names (such as "CPButton"), but the names returned by the class' +defaultThemeClass method. For example, the name for CPCheckBox is "check-box", as defined in CPCheckBox::themeClass.

Definition at line 103 of file CPTheme.j.

◆ defaultHudTheme()

+ (CPTheme) defaultHudTheme
implementation

The default HUD theme is (sometimes) used for windows with the CPHUDBackgroundWindowMask style mask. The default is theme with the name of the default theme with -HUD appended at the end.

Definition at line 63 of file CPTheme.j.

◆ defaultTheme()

+ (CPTheme) defaultTheme
implementation

Definition at line 44 of file CPTheme.j.

◆ encodeWithCoder:()

- (void) encodeWithCoder: (CPCoder aCoder
implementation

Provided by category CPTheme(CPCoding).

Definition at line 302 of file CPTheme.j.

◆ initWithCoder:()

- (id) initWithCoder: (CPCoder aCoder
implementation

Provided by category CPTheme(CPCoding).

Definition at line 287 of file CPTheme.j.

◆ initWithName:()

- (id) initWithName: (CPString aName
implementation

Definition at line 75 of file CPTheme.j.

◆ isCSSBased()

- (BOOL) isCSSBased
implementation

Provided by category CPTheme(CSSTheming).

Definition at line 366 of file CPTheme.j.

◆ name()

- (CPString) name
implementation

Definition at line 90 of file CPTheme.j.

◆ setCSSResourcesPath:()

- (void) setCSSResourcesPath: (CPString pathToResources
implementation

Provided by category CPTheme(CSSTheming).

Definition at line 336 of file CPTheme.j.

◆ setDefaultHudTheme:()

+ (void) setDefaultHudTheme: (CPTheme aTheme
implementation

Set the default HUD theme. If set to nil, the default described in defaultHudTheme will be used.

Definition at line 53 of file CPTheme.j.

◆ setDefaultTheme:()

+ (void) setDefaultTheme: (CPTheme aTheme
implementation

Definition at line 39 of file CPTheme.j.

◆ takeThemeFromObject:()

- (void) takeThemeFromObject: (id)  anObject
implementation

Definition at line 246 of file CPTheme.j.

◆ themeNamed:()

+ (CPTheme) themeNamed: (CPString aName
implementation

Definition at line 70 of file CPTheme.j.

◆ valueForAttributeWithName:forClass:()

- (id) valueForAttributeWithName: (CPString aName
forClass: (id)  aClass 
implementation

Returns the value for a theme attribute in its normal state, as defined for the given class in the theme's ThemeDescriptors.j file.

aName should be the attribute name as you would pass to the method CPView::valueForThemeAttribute:.

For a description of valid values for aClass, see attributeNamesForClass:.

Parameters
aNameThe name of the attribute whose value you want to retrieve
aClassThe themed class in which to look for the attribute
Returns
A value or nil

Definition at line 218 of file CPTheme.j.

◆ valueForAttributeWithName:inState:forClass:()

- (id) valueForAttributeWithName: (CPString aName
inState: (ThemeState aState
forClass: (id)  aClass 
implementation

Returns the value for a theme attribute in a given state, as defined for the given class in the theme's ThemeDescriptors.j file. This is the equivalent of the method CPView::valueForThemeAttribute:inState:, but retrieves the value from the theme definition as opposed to a single view's current theme state.

For a description of valid values for aClass, see attributeNamesForClass:.

Parameters
aNameThe name of the attribute whose value you want to retrieve
aStateThe state qualifier for the attribute
aClassThe themed class in which to look for the attribute
Returns
A value or nil

Definition at line 236 of file CPTheme.j.


The documentation for this class was generated from the following files: