1. Technical Field
Embodiments of the present disclosure relate generally to file management, and more particularly, to a file management method and an electronic device having the file management function.
2. Description of Related Art
Touch screens are used in many electronic devices, such as mobile phones, personal digital assistants (PDA), and portable computers. Electronic files stored in these electronic devices may be copied, pasted, moved, deleted, and renamed using the touch screen. However, a plurality of steps is required to execute any of the above mentioned functions, which is inconvenient and time consuming. Further, it may be difficult to copy, paste, move, delete, and rename the files only by general touch operations on mere representations (icons) of the files displayed on the touch screen. Therefore, there is room for improvement in the art.
The disclosure, including the accompanying drawings, is illustrated by way of example and not by way of limitation. It should be noted that references to “an” or “one” embodiment in this disclosure are not necessarily to the same embodiment, and such references mean “at least one.”
The file management unit 400 may include a plurality of programs in the form of one or more computerized instructions stored in the storage 130 and executed by the processor 120 to perform operations of the electronic device 100. In the embodiment, the file management unit 400 includes a detection module 410, a determination module 420, and an execution module 430. In general, the word “module,” as used herein, refers to logic embodied in hardware or firmware, or to a collection of software instructions, written in a programming language, such as, Java, C, or assembly. One or more software instructions in the modules may be embedded in firmware, such as in an erasable programmable read only memory (EPROM). The modules described herein may be implemented as either software and/or hardware modules and may be stored in any type of non-transitory computer-readable medium or other storage devices. Some non-limiting examples of non-transitory computer-readable medium include CDs, DVDs, BLU-RAY, flash memory, and hard disk drives.
The detection module 410 detects touches applied to icons of files of the electronic device 100. The touches may be done with a finger or a tool, such as a stylus. The files may be files of various applications, photos, documents, or others similar files stored in the storage 130 of the electronic device 100.
When a touch applied to an icon of a file is detected, the determination module 420 determines whether the touch is a held touch lasting for more than a predetermined time, such as two or three seconds. If the touch is the held touch, the determination module 420 determines whether the held touch slides along one of a number of predetermined directions, the number of predetermined directions being one or more.
If the held touch does slide along one predetermined direction, the execution module 430 executes a predetermined operation on the file, for example, copying or deleting the file. In the embodiment, each of the predetermined directions corresponds to a predetermined operation, and the predetermined operation executed by the execution module 430 corresponds to a predetermined direction.
In other embodiments, if the held touch slides along a predetermined direction, the execution module 430 may display a predetermined menu including a plurality of options (e.g., “save as”, “move”, “rename”, “copy”, and “delete”) on the touch screen 110, and then execute a function corresponding to the option selected by a user.
In one example, as shown in
In step S1, the detection module 410 detects touches applied to icons of files (e.g., files of various types and applications) of the electronic device 100.
In step S2, when a touch applied to an icon of a file is detected, a determination is made by the determination module 420 as to whether the touch is a held touch lasting for more than a predetermined time (e.g., two or three seconds). If the touch is a held touch, the process goes to step S3. If the touch is not a held touch, the process terminates.
In step S3, the determination module 420 determines whether the held touch slides along one of a number of predetermined directions, the number of predetermined directions being one or more. If the held touch does slide along one predetermined direction, the process goes to step S4. Otherwise, if the held touch does not slide along any of the predetermined directions, the process terminates.
In step S4, the execution module 430 executes a predetermined operation on the file, or displays a predetermined menu including a plurality of options (e.g., “save as”, “move”, “rename”, “copy”, and “delete”) on the touch screen 110.
Under the condition that the predetermined menu has been displayed on the touch screen, when an option of the predetermined menu is selected by a user, the execution module 430 executes the function corresponding to the selected option. In one example of the present embodiment, the predetermined directions include a first, second, third, and fourth predetermined directions, which are substantially left, right, up, and down.
In step S5, the determination module 420 determines whether the held touch slides along the first predetermined direction, and if the held touch does slide along the first predetermined direction, step S10 is implemented. Otherwise, the procedure goes to step S6.
In step S6, the determination module 420 determines whether the held touch slides along the second predetermined direction, and if the held touch does slide along the second predetermined direction, step S11 is implemented. Otherwise, the procedure goes to step S7.
In step S7, the determination module 420 determines whether the held touch slides along the third predetermined direction, and if the held touch does slide along the third predetermined direction, step S12 is implemented. Otherwise, the procedure goes to step S8.
In step S8, the determination module 420 determines whether the held touch slides along the fourth predetermined direction, and if the held touch does slide along the fourth predetermined direction, step S13 is implemented. Otherwise, the procedure terminates.
In step S10, the first execution sub-module 431 executes a first predetermined operation on the file (e.g., to copy the file), or the second execution sub-module 432 displays a first predetermined menu including a first group of options. Then the procedure goes to step S14.
In step S11, the first execution sub-module 431 executes a second predetermined operation on the file (e.g., to rename the file), or the second execution sub-module 432 displays a second predetermined menu including a second group of options. Then the procedure goes to step S14.
In step S12, the first execution sub-module 431 executes a third predetermined operation on the file (e.g., to move the file), or the second execution sub-module 432 displays a third predetermined menu including a third group of options. Then the procedure goes to step S14.
In step S13, the first execution sub-module 431 executes a fourth predetermined operation on the file (e.g., to delete the file), or the second execution sub-module 432 displays a fourth predetermined menu including a fourth group of options. Then the procedure goes to step S14.
In step S14, under the condition that the first, second, third, or fourth predetermined menus is displayed on the touch screen 110, the function corresponding to the selected option is executed by the second execution sub-module 432 when an option of the first, second, third, or fourth predetermined menus is selected.
Although certain embodiments of the present disclosure have been specifically described, the present disclosure is not to be construed as being limited thereto. Various changes or modifications may be made to the present disclosure without departing from the scope and spirit of the present disclosure.
Number | Date | Country | Kind |
---|---|---|---|
201210063071.7 | Mar 2012 | CN | national |