From 585b64b1764c32cb97fe7f945bc6016d711137c4 Mon Sep 17 00:00:00 2001 From: Peter Hosey Date: Mon, 1 May 2006 00:34:32 +0000 Subject: [PATCH] Moved documentation to header and shined it up. git-svn-id: svn://svn.adiumx.com/adium/trunk@15919 1c916fce-81e2-0310-a464-8ca513f45935 --- .../Source/AIToolbarUtilities.h | 40 ++++++++++++++++++++ .../Source/AIToolbarUtilities.m | 43 ---------------------- 2 files changed, 40 insertions(+), 43 deletions(-) diff --git a/Frameworks/AIUtilities Framework/Source/AIToolbarUtilities.h b/Frameworks/AIUtilities Framework/Source/AIToolbarUtilities.h index 737a0ff03..01b416be7 100644 --- a/Frameworks/AIUtilities Framework/Source/AIToolbarUtilities.h +++ b/Frameworks/AIUtilities Framework/Source/AIToolbarUtilities.h @@ -14,10 +14,30 @@ \------------------------------------------------------------------------------------------------------ */ +/*! @class AIToolbarUtilities + * @brief Helpful methods for creating window toolbar items. + * + * Methods for conveniently creating, storing, and retrieivng \c NSToolbarItem objects. + */ @interface AIToolbarUtilities : NSObject { } +/*! @brief Create an \c NSToolbarItem and add it to an \c NSDictionary + * +* Calls +toolbarItemWithIdentifier:label:paletteLabel:toolTip:target:settingSelector:itemContent:action:menu: and adds the result to a dictionary (\a theDict). + * + * @param theDict A dictionary in which to store the \c NSToolbarItem. + * @param identifier + * @param label + * @param paletteLabel + * @param toolTip + * @param target + * @param action + * @param settingSelector Selector to call on the \c NSToolbarItem after it is created. It should take a single object, which will be \a itemContent. May be \c nil. + * @param itemContent Object for \c settingSelector. May be \c nil. + * @param menu A menu to set on the \c NSToolbarItem. It will be automatically encapsulated by an \c NSMenuItem as \c NSToolbarItem requires. + */ + (void)addToolbarItemToDictionary:(NSMutableDictionary *)theDict withIdentifier:(NSString *)identifier label:(NSString *)label @@ -29,6 +49,19 @@ action:(SEL)action menu:(NSMenu *)menu; +/*! @brief Convenience method for creating an \c NSToolbarItem + * + * Parameters not discussed below are simply set using the \c NSToolbarItem setters; see its documentation for details. + * @param identifier + * @param label + * @param paletteLabel + * @param toolTip + * @param target + * @param action + * @param settingSelector Selector to call on the \c NSToolbarItem after it is created. It should take a single object, which will be \a itemContent. May be \c nil. + * @param itemContent Object for \c settingSelector. May be \c nil. + * @param menu A menu to set on the \c NSToolbarItem. It will be automatically encapsulated by an \c NSMenuItem as \c NSToolbarItem requires. + */ + (NSToolbarItem *)toolbarItemWithIdentifier:(NSString *)identifier label:(NSString *)label paletteLabel:(NSString *)paletteLabel @@ -39,6 +72,13 @@ action:(SEL)action menu:(NSMenu *)menu; +/*! @brief Retrieve a new \c NSToolbarItem instance based on a dictionary's entry + * + * Retrieves a new copy of the \c NSToolbarItem stored in \c theDict with the \c itemIdentifier identifier. This should be used rather than simply copying the existing \c NSToolbarItem so custom copying behaviors to maintain custom view, image, and menu settings are utilized. + * @param theDict The source \c NSDictionary. + * @param itemIdentifier The identifier of the \c NSToolbarItem previous stored with +addToolbarItemToDictionary:withIdentifier:label:paletteLabel:toolTip:target:settingSelector:itemContent:action:menu:. + * @return The retrieved \c NSToolbarItem. + */ + (NSToolbarItem *)toolbarItemFromDictionary:(NSDictionary *)theDict withIdentifier:(NSString *)itemIdentifier; @end diff --git a/Frameworks/AIUtilities Framework/Source/AIToolbarUtilities.m b/Frameworks/AIUtilities Framework/Source/AIToolbarUtilities.m index 2870becbd..897811b5b 100644 --- a/Frameworks/AIUtilities Framework/Source/AIToolbarUtilities.m +++ b/Frameworks/AIUtilities Framework/Source/AIToolbarUtilities.m @@ -15,29 +15,8 @@ #import "AIToolbarUtilities.h" -/*! - * @class AIToolbarUtilities - * @brief Helpful methods for creating window toolbar items - * - * Methods for conveniently creating, storing, and retrieivng NSToolbarItem objects. - */ @implementation AIToolbarUtilities -/*! - * @brief Create an NSToolbarItem and add it to an NSDictionary - * - * Calls toolbarItemWithIdentifier:label:paletteLabel:toolTip:target:settingSelector:itemContent:action:menu: and adds the result to a dictionary. - * @param theDict A dictionary in which to store the NSToolbarItem - * @param identifier - * @param label - * @param paletteLabel - * @param toolTip - * @param target - * @param action - * @param settingSelector Selector to call on the NSToolbarItem after it is created. It should take a single object, which will be itemContent. May be nil. - * @param itemContent Object for settingSelector. May be nil. - * @param menu A menu to set on the NSToolbarItem. It will be automatically encapsulated by an NSMenuItem as NSToolbarItem requires. - */ + (void)addToolbarItemToDictionary:(NSMutableDictionary *)theDict withIdentifier:(NSString *)identifier label:(NSString *)label paletteLabel:(NSString *)paletteLabel toolTip:(NSString *)toolTip target:(id)target settingSelector:(SEL)settingSelector itemContent:(id)itemContent action:(SEL)action menu:(NSMenu *)menu { NSToolbarItem *item = [self toolbarItemWithIdentifier:identifier label:label paletteLabel:paletteLabel toolTip:toolTip target:target settingSelector:settingSelector itemContent:itemContent action:action menu:menu]; @@ -45,20 +24,6 @@ [theDict setObject:item forKey:identifier]; } -/*! - * @brief Convenience method for creating an NSToolbarItem - * - * Parameters not discussed below are simply set using the NSToolbarItem setters; see its documentation for details. - * @param identifier - * @param label - * @param paletteLabel - * @param toolTip - * @param target - * @param action - * @param settingSelector Selector to call on the NSToolbarItem after it is created. It should take a single object, which will be itemContent. May be nil. - * @param itemContent Object for settingSelector. May be nil. - * @param menu A menu to set on the NSToolbarItem. It will be automatically encapsulated by an NSMenuItem as NSToolbarItem requires. - */ + (NSToolbarItem *)toolbarItemWithIdentifier:(NSString *)identifier label:(NSString *)label paletteLabel:(NSString *)paletteLabel toolTip:(NSString *)toolTip target:(id)target settingSelector:(SEL)settingSelector itemContent:(id)itemContent action:(SEL)action menu:(NSMenu *)menu { NSToolbarItem *item = [[[NSToolbarItem alloc] initWithItemIdentifier:identifier] autorelease]; @@ -98,14 +63,6 @@ return item; } -/*! - * @brief Retrieve a new NSToolbarItem instance based on a dictionary's entry - * - * Retrieves a new copy of the NSToolbarItem stored in theDict with the itemIdentifier identifier. This should be used rather than simply copying the existing NSToolbarItem so custom copying behaviors to maintain custom view, image, and menu settings are utilized. - * @param theDict The source NSDictionary - * @param itemIdentifier The identifier of the NSToolbarItem previous stored with addToolbarItemToDictionary:withIdentifier:label:paletteLabel:toolTip:target:settingSelector:itemContent:action:menu: - * @return The retrieved NSToolbarItem - */ + (NSToolbarItem *)toolbarItemFromDictionary:(NSDictionary *)theDict withIdentifier:(NSString *)itemIdentifier { NSToolbarItem *item; -- 2.11.4.GIT