PageRenderTime 36ms CodeModel.GetById 28ms app.highlight 5ms RepoModel.GetById 2ms app.codeStats 0ms

/core/externals/google-toolbox-for-mac/AppKit/GTMLoginItems.h

http://macfuse.googlecode.com/
C++ Header | 88 lines | 13 code | 10 blank | 65 comment | 0 complexity | 9ca7c34f45e24c822bbd57f68c1e2267 MD5 | raw file
 1//
 2//  GTMLoginItems.h
 3//
 4//  Copyright 2007-2008 Google Inc.
 5//
 6//  Licensed under the Apache License, Version 2.0 (the "License"); you may not
 7//  use this file except in compliance with the License.  You may obtain a copy
 8//  of the License at
 9// 
10//  http://www.apache.org/licenses/LICENSE-2.0
11// 
12//  Unless required by applicable law or agreed to in writing, software
13//  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14//  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
15//  License for the specific language governing permissions and limitations under
16//  the License.
17//
18
19#import <Foundation/Foundation.h>
20#import "GTMDefines.h"
21
22/// Login items key constants, used as keys in |+loginItems|
23//
24// Item name
25GTM_EXTERN NSString * const kGTMLoginItemsNameKey;
26// Item path
27GTM_EXTERN NSString * const kGTMLoginItemsPathKey;
28// Hidden (NSNumber bool)
29GTM_EXTERN NSString * const kGTMLoginItemsHiddenKey;
30
31/// GTMLoginItems
32//
33///  A helper class to manipulate the user's Login Items.
34@interface GTMLoginItems : NSObject
35
36/// Obtain a complete list of all login items.
37//
38//  Returns:
39//    Autoreleased array of dictionaries keyed with kGTMLoginItemsPathKey, etc.
40//
41+ (NSArray *)loginItems:(NSError **)errorInfo;
42
43/// Check if the given path is in the current user's Login Items
44//
45//  Args:
46//    path: path to the application
47//
48//  Returns:
49//   YES if the path is in the Login Items
50// 
51+ (BOOL)pathInLoginItems:(NSString *)path;
52
53/// Check if the given name is in the current user's Login Items
54//
55//  Args:
56//    name: name to the application
57//
58//  Returns:
59//   YES if the name is in the Login Items
60// 
61+ (BOOL)itemWithNameInLoginItems:(NSString *)name;
62
63/// Add the given path to the current user's Login Items. Does nothing if the
64/// path is already there.
65//
66// Args:
67//   path: path to add
68//   hide: Set to YES to have the item launch hidden
69//
70+ (void)addPathToLoginItems:(NSString *)path hide:(BOOL)hide;
71
72/// Remove the given path from the current user's Login Items. Does nothing if
73/// the path is not there.
74//
75//  Args:
76//    path: the path to remove
77//
78+ (void)removePathFromLoginItems:(NSString *)path;
79
80/// Remove the given item name from the current user's Login Items. Does nothing
81/// if no item with that name is present.
82//
83//  Args:
84//    name: name of the item to remove
85//
86+ (void)removeItemWithNameFromLoginItems:(NSString *)name;
87
88@end