Foodolini.Activities.FoodRegistration.FoodRegistrationActivity Class Reference

create a new FoodregistrationActivity open the camera creates the treeview for scanned fooditems sets the treeview to single select More...

Inherits Foodolini::Activities::IActivity.

Collaboration diagram for Foodolini.Activities.FoodRegistration.FoodRegistrationActivity:
Collaboration graph

List of all members.

Public Member Functions

 FoodRegistrationActivity ()
void Register (IOwner owner)
 Subscribe to the events exposed by owner, and store a reference to owner.
void Unregister ()
 Unsubscribe to the events exposed by owner, and loose any references to owner.

Protected Member Functions

virtual void OnRefreshButtonClicked (object sender, System.EventArgs e)
virtual void OnFlipButtonToggled (object sender, System.EventArgs e)
 Flip the image on/off.
virtual void OnClearBarCodeButtonClicked (object sender, System.EventArgs e)
 clears the barcode label, and set code = null
virtual void OnFoodViewCursorChanged (object sender, System.EventArgs e)
 Update current FoodItem and editor, and set barcode = null.
virtual void OnQuantitySpinbuttonValueChanged (object sender, System.EventArgs e)
 Update quantity of current FoodItem and bar code if not null.
virtual void OnDuplicateButtonClicked (object sender, System.EventArgs e)
 Duplicate current FoodItem.
virtual void CalendarChanged (object sender, System.EventArgs e)
 Update expiration date of current FoodItem.
virtual void Build ()

Properties

Widget Widget [get]

Private Member Functions

void HandleHidden (object sender, EventArgs e)
void HandleDestroyed (object sender, EventArgs e)
void HandleShown (object sender, EventArgs e)
void HandleStopped (object sender, EventArgs e)
 Handles Stopped event, if exception occurs in Scanner.
void HandleError (object sender, ErrorEventArgs e)
 Displays hardware related errors that the occurs in the scanner.
void PopulateVideoSourceComboBox ()
void HandleDeviceAdded (object sender, DeviceEventArgs e)
 Handle new device found.
void HandleDeviceRemoved (object sender, DeviceEventArgs e)
 Handle device removed.
void OnVideoSourceComboBoxChanged (object sender, System.EventArgs e)
void OnMuteButtonClicked (object sender, System.EventArgs e)
void UpdateMuteButton ()
 Update the image for the mute button.
void OnSaveButtonClicked (object sender, System.EventArgs e)
 save the fooditem in the treeview when the user clicks save
void OnCancelButtonClicked (object sender, System.EventArgs e)
 returns the user to previousactivity <remarks activate the confirmation dialog in the unloadevent if the user have unsaved items
void OwnerhandleActivityUnloading (object sender, ActivityUnloadedArgs e)
 if activated by a canclled event promts the user for confirmation before leaveing and allow the user to call the SaveButton.Click first.
void OnRemoveButtonClicked (object sender, System.EventArgs e)
 remove the selectet fooditem from the treview list
void OnAddButtonClicked (object sender, System.EventArgs e)
 creates a new fooditem without bar code
void OnSelectIngredientButtonClicked (object sender, System.EventArgs e)
 opens a new IngredientSelector dialog where the user can select an Ingredient to associate with the barcode
void OnScannerBarScanned (object sender, BarScannedArgs e)
 Create FoodItem for barcode, and set code, show ingredient dialog if barcode is unknown.
void UpdateEditor ()
 Update the widgets in the editor according to internal state.
BarCodeType FromZBarType (SymbolType symbol)
 Convert ZBar type to Foodolini BarCodeType.

Private Attributes

NodeStore foodList = new NodeStore(typeof(FoodItemAdapter))
IOwner owner
string currentDevice = null
ListStore VideoSources = new ListStore(typeof(string), typeof(string))
TreeIter NoVideoIter
bool IgnoreVideoSourceComboBoxChanged = false
Gtk.Image muteImage = new Gtk.Image(null, "FoodRegistration.muted.png")
Gtk.Image unmuteImage = new Gtk.Image(null, "FoodRegistration.audio.png")
bool cancelled = true
FoodItemAdapter current = null
 Currently selected FoodItem, null if none.
BarCode code = null
 Current bar code, null if none.
Gtk.VBox vbox1
Gtk.HBox hbox1
Gtk.Table table1
Gtk.Button AddButton
Gtk.Calendar ExpirationCalendar
Gtk.HBox hbox2
Gtk.Label label6
Gtk.Label BarCodeLabel
Gtk.Button ClearBarCodeButton
Gtk.HButtonBox hbuttonbox2
Gtk.Button DuplicateButton
Gtk.Button RemoveButton
Gtk.Label IngredientLabel
Gtk.Label label2
Gtk.Label label3
Gtk.Label label5
Gtk.SpinButton QuantitySpinbutton
Gtk.Button SelectIngredientButton
Gtk.VBox vbox2
Foodolini.Activities.FoodRegistration.Scanner scanner
Gtk.HBox hbox4
Gtk.ComboBox VideoSourceComboBox
Gtk.Button RefreshButton
Gtk.ToggleButton FlipButton
Gtk.Button MuteButton
Gtk.ScrolledWindow GtkScrolledWindow
Gtk.NodeView FoodView
Gtk.HButtonBox hbuttonbox1
Gtk.Button CancelButton
Gtk.Button SaveButton

Detailed Description

create a new FoodregistrationActivity open the camera creates the treeview for scanned fooditems sets the treeview to single select

Definition at line 21 of file FoodRegistrationActivity.cs.


Constructor & Destructor Documentation

Foodolini.Activities.FoodRegistration.FoodRegistrationActivity.FoodRegistrationActivity (  ) 

Definition at line 27 of file FoodRegistrationActivity.cs.


Member Function Documentation

virtual void Foodolini.Activities.FoodRegistration.FoodRegistrationActivity.Build (  )  [protected, virtual]
virtual void Foodolini.Activities.FoodRegistration.FoodRegistrationActivity.CalendarChanged ( object  sender,
System.EventArgs  e 
) [protected, virtual]

Update expiration date of current FoodItem.

Definition at line 565 of file FoodRegistrationActivity.cs.

BarCodeType Foodolini.Activities.FoodRegistration.FoodRegistrationActivity.FromZBarType ( SymbolType  symbol  )  [private]

Convert ZBar type to Foodolini BarCodeType.

Definition at line 578 of file FoodRegistrationActivity.cs.

void Foodolini.Activities.FoodRegistration.FoodRegistrationActivity.HandleDestroyed ( object  sender,
EventArgs  e 
) [private]

Definition at line 81 of file FoodRegistrationActivity.cs.

void Foodolini.Activities.FoodRegistration.FoodRegistrationActivity.HandleDeviceAdded ( object  sender,
DeviceEventArgs  e 
) [private]

Handle new device found.

Definition at line 216 of file FoodRegistrationActivity.cs.

void Foodolini.Activities.FoodRegistration.FoodRegistrationActivity.HandleDeviceRemoved ( object  sender,
DeviceEventArgs  e 
) [private]

Handle device removed.

Definition at line 232 of file FoodRegistrationActivity.cs.

void Foodolini.Activities.FoodRegistration.FoodRegistrationActivity.HandleError ( object  sender,
ErrorEventArgs  e 
) [private]

Displays hardware related errors that the occurs in the scanner.

Definition at line 120 of file FoodRegistrationActivity.cs.

void Foodolini.Activities.FoodRegistration.FoodRegistrationActivity.HandleHidden ( object  sender,
EventArgs  e 
) [private]

Definition at line 77 of file FoodRegistrationActivity.cs.

void Foodolini.Activities.FoodRegistration.FoodRegistrationActivity.HandleShown ( object  sender,
EventArgs  e 
) [private]

Definition at line 96 of file FoodRegistrationActivity.cs.

void Foodolini.Activities.FoodRegistration.FoodRegistrationActivity.HandleStopped ( object  sender,
EventArgs  e 
) [private]

Handles Stopped event, if exception occurs in Scanner.

Definition at line 112 of file FoodRegistrationActivity.cs.

void Foodolini.Activities.FoodRegistration.FoodRegistrationActivity.OnAddButtonClicked ( object  sender,
System.EventArgs  e 
) [private]

creates a new fooditem without bar code

Definition at line 413 of file FoodRegistrationActivity.cs.

void Foodolini.Activities.FoodRegistration.FoodRegistrationActivity.OnCancelButtonClicked ( object  sender,
System.EventArgs  e 
) [private]

returns the user to previousactivity <remarks activate the confirmation dialog in the unloadevent if the user have unsaved items

Parameters:
sender A System.Object
e A System.EventArgs

Definition at line 362 of file FoodRegistrationActivity.cs.

virtual void Foodolini.Activities.FoodRegistration.FoodRegistrationActivity.OnClearBarCodeButtonClicked ( object  sender,
System.EventArgs  e 
) [protected, virtual]

clears the barcode label, and set code = null

Definition at line 489 of file FoodRegistrationActivity.cs.

virtual void Foodolini.Activities.FoodRegistration.FoodRegistrationActivity.OnDuplicateButtonClicked ( object  sender,
System.EventArgs  e 
) [protected, virtual]

Duplicate current FoodItem.

Definition at line 555 of file FoodRegistrationActivity.cs.

virtual void Foodolini.Activities.FoodRegistration.FoodRegistrationActivity.OnFlipButtonToggled ( object  sender,
System.EventArgs  e 
) [protected, virtual]

Flip the image on/off.

Definition at line 301 of file FoodRegistrationActivity.cs.

virtual void Foodolini.Activities.FoodRegistration.FoodRegistrationActivity.OnFoodViewCursorChanged ( object  sender,
System.EventArgs  e 
) [protected, virtual]

Update current FoodItem and editor, and set barcode = null.

Definition at line 533 of file FoodRegistrationActivity.cs.

void Foodolini.Activities.FoodRegistration.FoodRegistrationActivity.OnMuteButtonClicked ( object  sender,
System.EventArgs  e 
) [private]

Definition at line 280 of file FoodRegistrationActivity.cs.

virtual void Foodolini.Activities.FoodRegistration.FoodRegistrationActivity.OnQuantitySpinbuttonValueChanged ( object  sender,
System.EventArgs  e 
) [protected, virtual]

Update quantity of current FoodItem and bar code if not null.

Definition at line 541 of file FoodRegistrationActivity.cs.

virtual void Foodolini.Activities.FoodRegistration.FoodRegistrationActivity.OnRefreshButtonClicked ( object  sender,
System.EventArgs  e 
) [protected, virtual]

Definition at line 154 of file FoodRegistrationActivity.cs.

void Foodolini.Activities.FoodRegistration.FoodRegistrationActivity.OnRemoveButtonClicked ( object  sender,
System.EventArgs  e 
) [private]

remove the selectet fooditem from the treview list

Definition at line 403 of file FoodRegistrationActivity.cs.

void Foodolini.Activities.FoodRegistration.FoodRegistrationActivity.OnSaveButtonClicked ( object  sender,
System.EventArgs  e 
) [private]

save the fooditem in the treeview when the user clicks save

Parameters:
sender A System.Object
e A System.EventArgs

Definition at line 338 of file FoodRegistrationActivity.cs.

void Foodolini.Activities.FoodRegistration.FoodRegistrationActivity.OnScannerBarScanned ( object  sender,
BarScannedArgs  e 
) [private]

Create FoodItem for barcode, and set code, show ingredient dialog if barcode is unknown.

Definition at line 456 of file FoodRegistrationActivity.cs.

void Foodolini.Activities.FoodRegistration.FoodRegistrationActivity.OnSelectIngredientButtonClicked ( object  sender,
System.EventArgs  e 
) [private]

opens a new IngredientSelector dialog where the user can select an Ingredient to associate with the barcode

Definition at line 434 of file FoodRegistrationActivity.cs.

void Foodolini.Activities.FoodRegistration.FoodRegistrationActivity.OnVideoSourceComboBoxChanged ( object  sender,
System.EventArgs  e 
) [private]

Definition at line 260 of file FoodRegistrationActivity.cs.

void Foodolini.Activities.FoodRegistration.FoodRegistrationActivity.OwnerhandleActivityUnloading ( object  sender,
ActivityUnloadedArgs  e 
) [private]

if activated by a canclled event promts the user for confirmation before leaveing and allow the user to call the SaveButton.Click first.

Parameters:
sender A System.Object
e A ActivityUnloadedArgs

Definition at line 377 of file FoodRegistrationActivity.cs.

void Foodolini.Activities.FoodRegistration.FoodRegistrationActivity.PopulateVideoSourceComboBox (  )  [private]

Definition at line 129 of file FoodRegistrationActivity.cs.

void Foodolini.Activities.FoodRegistration.FoodRegistrationActivity.Register ( IOwner  owner  ) 

Subscribe to the events exposed by owner, and store a reference to owner.

Parameters:
owner Instance of an implementation of IOwner

Implements Foodolini.Activities.IActivity.

Definition at line 313 of file FoodRegistrationActivity.cs.

void Foodolini.Activities.FoodRegistration.FoodRegistrationActivity.Unregister (  ) 

Unsubscribe to the events exposed by owner, and loose any references to owner.

Implements Foodolini.Activities.IActivity.

Definition at line 318 of file FoodRegistrationActivity.cs.

void Foodolini.Activities.FoodRegistration.FoodRegistrationActivity.UpdateEditor (  )  [private]

Update the widgets in the editor according to internal state.

Definition at line 499 of file FoodRegistrationActivity.cs.

void Foodolini.Activities.FoodRegistration.FoodRegistrationActivity.UpdateMuteButton (  )  [private]

Update the image for the mute button.

Definition at line 291 of file FoodRegistrationActivity.cs.


Member Data Documentation

Definition at line 327 of file FoodRegistrationActivity.cs.

Current bar code, null if none.

Definition at line 451 of file FoodRegistrationActivity.cs.

Currently selected FoodItem, null if none.

Definition at line 398 of file FoodRegistrationActivity.cs.

Definition at line 107 of file FoodRegistrationActivity.cs.

Definition at line 24 of file FoodRegistrationActivity.cs.

Definition at line 259 of file FoodRegistrationActivity.cs.

Gtk.Image Foodolini.Activities.FoodRegistration.FoodRegistrationActivity.muteImage = new Gtk.Image(null, "FoodRegistration.muted.png") [private]

Definition at line 285 of file FoodRegistrationActivity.cs.

Definition at line 128 of file FoodRegistrationActivity.cs.

Definition at line 25 of file FoodRegistrationActivity.cs.

Gtk.Image Foodolini.Activities.FoodRegistration.FoodRegistrationActivity.unmuteImage = new Gtk.Image(null, "FoodRegistration.audio.png") [private]

Definition at line 286 of file FoodRegistrationActivity.cs.

ListStore Foodolini.Activities.FoodRegistration.FoodRegistrationActivity.VideoSources = new ListStore(typeof(string), typeof(string)) [private]

Definition at line 127 of file FoodRegistrationActivity.cs.


Property Documentation

Widget Foodolini.Activities.FoodRegistration.FoodRegistrationActivity.Widget [get]

Implements Foodolini.Activities.IActivity.

Definition at line 309 of file FoodRegistrationActivity.cs.


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

Foodolini 1.0.0 Documentation, generated with DoxyGen.