(command: NavigationCommand, param: NavigationParam)
| 716 | |
| 717 | |
| 718 | fn navigation_command_string(command: NavigationCommand, param: NavigationParam) -> &'static str { |
| 719 | match command { |
| 720 | NavigationCommand::Move => { |
| 721 | return match param { |
| 722 | NavigationParam::Previous => "MovePrevious", |
| 723 | NavigationParam::Next => "MoveNext", |
| 724 | NavigationParam::Start => "MoveStart", |
| 725 | NavigationParam::End => "MoveEnd", |
| 726 | NavigationParam::LineStart => "MoveLineStart", |
| 727 | NavigationParam::LineEnd => "MoveLineEnd", |
| 728 | NavigationParam::CellPrevious => "MoveCellPrevious", |
| 729 | NavigationParam::CellNext => "MoveCellNext", |
| 730 | NavigationParam::CellUp => "MoveCellUp", |
| 731 | NavigationParam::CellDown => "MoveCellDown", |
| 732 | NavigationParam::ColStart => "MoveColumnStart", |
| 733 | NavigationParam::ColEnd => "MoveColumnEnd", |
| 734 | _ => { |
| 735 | if param < NavigationParam::Placemarker0 || param > NavigationParam::Placemarker9 { |
| 736 | panic!("Internal Error: Found illegal value for param of NavigationCommand::Move"); |
| 737 | } |
| 738 | static MOVE_TO: &[&str] = &["MoveTo0","MoveTo1","MoveTo2","MoveTo3","MoveTo4","MoveTo5","MoveTo6","MoveTo7","MoveTo8","MoveTo9"]; |
| 739 | return MOVE_TO[(param as usize) - (NavigationParam::Placemarker0 as usize)]; |
| 740 | } |
| 741 | } |
| 742 | }, |
| 743 | NavigationCommand::Zoom => { |
| 744 | return match param { |
| 745 | NavigationParam::Next => "ZoomIn", |
| 746 | NavigationParam::Previous => "ZoomOut", |
| 747 | NavigationParam::Start => "ZoomOutAll", |
| 748 | NavigationParam::End => "ZoomInAll", |
| 749 | _ => panic!("Illegal param for NavigationCommand::Zoom"), |
| 750 | } |
| 751 | }, |
| 752 | NavigationCommand::MoveLastLocation => { |
| 753 | return "MoveLastLocation"; |
| 754 | }, |
| 755 | NavigationCommand::Read => { |
| 756 | return match param { |
| 757 | NavigationParam::Previous => "ReadPrevious", |
| 758 | NavigationParam::Next => "ReadNext", |
| 759 | NavigationParam::Current => "ReadCurrent", |
| 760 | NavigationParam::CellCurrent => "ReadCellCurrent", |
| 761 | NavigationParam::Start => "ReadStart", |
| 762 | NavigationParam::End => "ReadEnd", |
| 763 | NavigationParam::LineStart => "ReadLineStart", |
| 764 | NavigationParam::LineEnd => "ReadLineEnd", |
| 765 | _ => { |
| 766 | if param < NavigationParam::Placemarker0 || param > NavigationParam::Placemarker9 { |
| 767 | panic!("Internal Error: Found illegal value for param of NavigationCommand::Move"); |
| 768 | } |
| 769 | static READ_PLACE_MARKERS: &[&str] = &["Read0","Read1","Read2","Read3","Read4","Read5","Read6","Read7","Read8","Read9"]; |
| 770 | return READ_PLACE_MARKERS[(param as usize) - (NavigationParam::Placemarker0 as usize)]; |
| 771 | }, |
| 772 | } |
| 773 | }, |
| 774 | NavigationCommand::Describe => { |
| 775 | return match param { |
no outgoing calls
no test coverage detected