aboutsummaryrefslogtreecommitdiffhomepage
path: root/cocoa/InfoBar.h
blob: a83a92c9bcf0ebaffbd54c9ce8e8688d07d054e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/**
 * Scintilla source code edit control
 * InfoBar.h - Implements special info bar with zoom info, caret position etc. to be used with
 *             ScintillaView.
 *
 * Mike Lischke <mlischke@sun.com>
 *
 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
 * This file is dual licensed under LGPL v2.1 and the Scintilla license (http://www.scintilla.org/License.txt).
 */

#import <Cocoa/Cocoa.h>
#import "InfoBarCommunicator.h"

/**
 * Extended text cell for vertically aligned text.
 */
@interface VerticallyCenteredTextFieldCell : NSTextFieldCell
{
	BOOL mIsEditingOrSelecting;
}

@end

@interface InfoBar : NSView <InfoBarCommunicator>
{
@private
  NSImage* mBackground;
  IBDisplay mDisplayMask;
  
  float mScaleFactor;
  NSPopUpButton* mZoomPopup;
  
  int mCurrentCaretX;
  int mCurrentCaretY;
  NSTextField* mCaretPositionLabel;
  NSTextField* mStatusTextLabel;
  
  id <InfoBarCommunicator> mCallback;
}

- (void) notify: (NotificationType) type message: (NSString*) message location: (NSPoint) location
          value: (float) value;
- (void) setCallback: (id <InfoBarCommunicator>) callback;

- (void) createItems;
- (void) layout;
- (void) setDisplay: (IBDisplay) display;
- (void) zoomItemAction: (id) sender;
- (void) setScaleFactor: (float) newScaleFactor adjustPopup: (BOOL) flag;
- (void) setCaretPosition: (NSPoint) position;
- (void) sizeToFit;

@end