PageRenderTime 19ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/core/externals/update-engine/externals/google-toolbox-for-mac/XcodePlugin/GTMXcodeMenuItem.h

http://macfuse.googlecode.com/
C++ Header | 69 lines | 20 code | 15 blank | 34 comment | 0 complexity | 802808797dc26c1bb6a45ca26663b2c8 MD5 | raw file
Possible License(s): Apache-2.0, BSD-3-Clause, GPL-2.0
  1. //
  2. // GTMXcodeMenuItem.h
  3. //
  4. // Copyright 2007-2009 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. #import <Cocoa/Cocoa.h>
  19. @class PBXTarget;
  20. @protocol GTMXcodeMenuItemProtocol
  21. // name of the menu item
  22. - (NSString*)title;
  23. // the action to perform
  24. - (SEL)actionSelector;
  25. // what menu to insert the item into
  26. - (NSMenu*)insertionMenu;
  27. // where we want the menu item inserted
  28. - (int)insertionIndex;
  29. // the hot key
  30. - (NSString*)keyEquivalent;
  31. // the depth of the item as a hierarchical menu item
  32. // eg 0 is in the root menu, 2 is in the Root:Debug:Attach menu
  33. - (int)depth;
  34. // method is called when the item is inserted
  35. - (void)wasInserted:(NSMenuItem*)item;
  36. // allow the icon to being added to make the menus easier to find
  37. - (BOOL)allowGDTMenuIcon;
  38. @end
  39. // Concrete implementation of GTMXcodeMenuItemProtocol for menu items
  40. // to inherit from.
  41. @interface GTMXcodeMenuItem : NSObject<GTMXcodeMenuItemProtocol>
  42. // the default action for menu items
  43. - (void)action:(id)sender;
  44. // returns the array of currently "selected files" in Xcode. This can be
  45. // the front most text document, or a selection out of the browser window.
  46. - (NSArray*)selectedPaths;
  47. // Expand |path| based on |target| and |configuration|.
  48. // If newPath is not absolute, expand kSrcRootPath and prepend it to newPath.
  49. - (NSString *)pathByExpandingString:(NSString *)path
  50. forBuildConfiguration:(NSString *)configuration
  51. ofTarget:(PBXTarget *)target;
  52. // Used to figure out what order to install menu items
  53. - (NSComparisonResult)compareDepth:(id<GTMXcodeMenuItemProtocol>)item;
  54. @end